View Single Post
Old 05-28-2003, 03:53 PM   PM User | #1
dotcomjr
New to the CF scene

 
Join Date: May 2003
Location: scotland, UK
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
dotcomjr is an unknown quantity at this point
Question javaScript, can i have some help please?

I am writing a calculator and need to have a cheak in so that the user has to input data into all the required fields. i have got as far as getting it to display an alert if the field does not have a specific value in it, but i was wondering if there was anyone out there who knows what the code is to get it to only come up if there is not a number input into the field. here is what i have come up with so far.

if (var1="piece i require")
{alert ("Please enter number for (a)");
}
else
{document.form1.Answer.value=result;
}

if (var2="piece i require")
{alert ("please enter number for (b)");
}
else
{document.form1.Answer.value=result;
}

Thank you for you help.
p.s. if you need the whole code, just ask.
dotcomjr is offline   Reply With Quote