i have a simple form which i am tring to set the values of a column in my
table, i have tried the code below which works, but this gives my a submit btn
for each record, because i have hundreds of records i need one submit btn to
set all the values
is this possable?
***FORM***
<cfoutput query="Organ">
<table border="0">
<form name="form1" method="post" action="TempUpdate.cfm"><tr>
<td width="276"><input type="Text" size="3" name="OrganID"
value="#Organ.OrganID#">
<input type="Text" size="3" name="OrganName" value="#Organ.OrganName#">
</td>
<td width="107"><input type="submit" name="Submit" value="Submit">
</td>
</tr></form>
</table>
</cfoutput>
***ACTION***
<cfquery datasource="DPSGuide">
UPDATE Aged_Care_Facility_Details
SET
ACAS_RegionIDNo = #form.OrganID#
WHERE OrganisationName = '#form.OrganName#'
</cfquery>
Ashish_Saxena - 30 Jan 2006 09:43 GMT
Hi
Followinf code may help you to.
<head>
<SCRIPT language="JavaScript">
function val()
{
var strSelectedRow = new String();
var strEnteredValue = new String();
var setFirstRow = true;
for(var i=0;i < 15;i++)
{//for
//alert("document.postForm.AA[i].value = "+
document.postForm.AA[i].value )
if(document.postForm.AA[i].value != "")
{//if AAA
if(setFirstRow)
{
strSelectedRow = document.postForm.hiddenRowCount[i].value;
strEnteredValue = document.postForm.AA[i].value;
setFirstRow= false;
}
else
{
strSelectedRow = strSelectedRow+","+
document.postForm.hiddenRowCount[i].value;
strEnteredValue = strEnteredValue+","+ document.postForm.AA[i].value;
}
}//if AAA
}//for
alert("strSelectedRow = "+strSelectedRow);
alert("strEnteredValue = "+strEnteredValue);
//document.postForm.action='index.cfm?fuseaction=FinalizeShipmentReport';
document.postForm.action='try.cfm?strSelectedRowURL='+strSelectedRow+'&strEn
teredValueURL='+strEnteredValue;
document.postForm.submit();
}
</SCRIPT>
</head>
<cfparam name="URL.strSelectedRowURL" default="nothing">
<cfparam name="URL.strEnteredValueURL" default="nothing">
<cfif URL.strSelectedRowURL IS NOT 'nothing'>
<cfoutput>
URL.strSelectedRowURL = #URL.strSelectedRowURL#<br>
URL.strEnteredValueURL = #URL.strEnteredValueURL#
</cfoutput>
</cfif>
<form name="postForm" METHOD="post" >
<cfloop index="i" from="1" to="15">
<input type="text" name="AA"> <br>
<INPUT type="hidden" NAME="hiddenRowCount"
value="<CFOUTPUT>#i#</CFOUTPUT>"> <!--- Passing hidden value along with every
test field --->
</cfloop>
<INPUT type="button" NAME="Update" value="Press Me" onClick="val();">
</form>
Ashish_Saxena - 30 Jan 2006 09:43 GMT
Hi
Followinf code may help you to.
<head>
<SCRIPT language="JavaScript">
function val()
{
var strSelectedRow = new String();
var strEnteredValue = new String();
var setFirstRow = true;
for(var i=0;i < 15;i++)
{//for
//alert("document.postForm.AA[i].value = "+
document.postForm.AA[i].value )
if(document.postForm.AA[i].value != "")
{//if AAA
if(setFirstRow)
{
strSelectedRow = document.postForm.hiddenRowCount[i].value;
strEnteredValue = document.postForm.AA[i].value;
setFirstRow= false;
}
else
{
strSelectedRow = strSelectedRow+","+
document.postForm.hiddenRowCount[i].value;
strEnteredValue = strEnteredValue+","+ document.postForm.AA[i].value;
}
}//if AAA
}//for
alert("strSelectedRow = "+strSelectedRow);
alert("strEnteredValue = "+strEnteredValue);
//document.postForm.action='index.cfm?fuseaction=FinalizeShipmentReport';
document.postForm.action='try.cfm?strSelectedRowURL='+strSelectedRow+'&strEn
teredValueURL='+strEnteredValue;
document.postForm.submit();
}
</SCRIPT>
</head>
<cfparam name="URL.strSelectedRowURL" default="nothing">
<cfparam name="URL.strEnteredValueURL" default="nothing">
<cfif URL.strSelectedRowURL IS NOT 'nothing'>
<cfoutput>
URL.strSelectedRowURL = #URL.strSelectedRowURL#<br>
URL.strEnteredValueURL = #URL.strEnteredValueURL#
</cfoutput>
</cfif>
<form name="postForm" METHOD="post" >
<cfloop index="i" from="1" to="15">
<input type="text" name="AA"> <br>
<INPUT type="hidden" NAME="hiddenRowCount"
value="<CFOUTPUT>#i#</CFOUTPUT>"> <!--- Passing hidden value along with every
test field --->
</cfloop>
<INPUT type="button" NAME="Update" value="Press Me" onClick="val();">
</form>