PDA

View Full Version : What am I over looking?


whg
08-09-2002, 04:35 PM
I'm new to scripting.

I have a form that calls my .js file.

I have a function that I call from a button. This function read
a count value of the number of hidden fields the form has, this varies.
1st I check to see if I have a 9 digit value in my seed field.
if not send alert.
if so then I want to loop through the hidden fields and plug in my values.
My problem is this. I keep getting a error
on the alert line in the 1st part of the if.
what am I over looking here?

** code **
function changeall()
{
var wstr="";
if(document.efrm2.chgal.value.length<9)
{
Alert("You must enter a 9 digit number in the Change value field to use Change All!");
}
else
{
rcn = document.efrm2.rcnt.value ;
for(var i = 1; i <= rcn; i++)
{
wstr="";
wstr = document.efrm2.efroSSN.value + "/" + document.efrm2.chgal.value + "/X" ;
document.efrm2["rec_" + i].value = wstr ;
}
}
}:confused:

whg
08-09-2002, 04:54 PM
Nevermind, I did not see the uppercase A on alert.