D
dewed
I know just enough javascript to hurt myself.. but hopefully someone
can point me in the right direction.
I have a pretty large form generated from an uploaded CSV file, the
form might have up to 100 select/option tags like this . . .
<select name="qty2">
<option value="0">0</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="8">8</option>
</select>
qty2 is for the 2nd line of the file, and could be a maximum of qty100
I need a javascript function that will loop though qty2-qty100 and
reset all options to zero..
Something like this...
<SCRIPT LANGUAGE="JavaScript"><!--
function resetqty()
{
var lines=0;
while (lines<=100)
{
var element = 'qty'.lines;
document.forms['formname'].elements[element].value = "0";
lines++;
}
}
//-->
</SCRIPT>
but of course I don't know what I'm doing here, and I suspect my
element var
isn't doing what I had hoped.
can point me in the right direction.
I have a pretty large form generated from an uploaded CSV file, the
form might have up to 100 select/option tags like this . . .
<select name="qty2">
<option value="0">0</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="6">6</option>
<option value="8">8</option>
</select>
qty2 is for the 2nd line of the file, and could be a maximum of qty100
I need a javascript function that will loop though qty2-qty100 and
reset all options to zero..
Something like this...
<SCRIPT LANGUAGE="JavaScript"><!--
function resetqty()
{
var lines=0;
while (lines<=100)
{
var element = 'qty'.lines;
document.forms['formname'].elements[element].value = "0";
lines++;
}
}
//-->
</SCRIPT>
but of course I don't know what I'm doing here, and I suspect my
element var
isn't doing what I had hoped.