Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic form fields and JScript

2 views
Skip to first unread message

bclintonUSSI

unread,
Mar 8, 2005, 4:48:53 PM3/8/05
to
I use an output query to generate form fields with the same name. When passing
the values to Javascript, I can't tell what kind of object it is. Can anyone
help? If I send one item only it is normal. If I send a field with the same
name 3 times (qtyship = 1, 2, 4), the script can't process the object. What is
the objkect? It is not an array. Can't tell otherwise.

Code Sample(CF)
<select name="partnumber" >
<cfoutput><option value="#partnumber2#"
selected>#partnumber2#</option></cfoutput>
<cfoutput query="getparts"><option
value="#partnumber#">#partnumber#</option></cfoutput>
</select></td>


<Td>
<select name="partused"
onChange="createForm(DynamicCheckList.partused.value);">
<option value="OriginalParts" selected>ORIGINAL PART USED</option>
<option value="RMA">RMA</option>
<option value="RTS">RTS</option>
</select></td><td><span id=cust style="position:relative;"></span></td>
<cfoutput><input type="hidden" name="QTYShipped" value="#qtyinstalled#">
</cfoutput>
<td><cfoutput>#QtyInstalled#</cfoutput></td>
<td><cfoutput><input type=text name="quantity" value="#qtyinstalled#"
onchange="checkqty(DynamicCheckList.quantity.value,
DynamicCheckList.QTYShipped.value, DynamicCheckList.partused.value)">

</cfoutput></td>
Code Sample(Javascript)
function checkqty(value1, value2, parttype)
{

var roll=<cfoutput>#getpartinfo.recordcount#</cfoutput>;


window.alert(value1);
window.alert(value2);

for (i=1; i <= roll; i++)
{

strpart = parttype.substring(0, parttype.indexOf(","));
v1part = value1.substring(0, value1.indexOf(","));
v2part = value2.substring(0, value2.indexOf(","));
window.alert(strpart);
window.alert(v1part);
window.alert(v2part);

if (strpart == "RMA"){
window.alert("RMA will be performed")
}


var parttype = parttype.substring(parttype.indexOf(",")+1);
}
}

0 new messages