dotcomjr
05-28-2003, 03:53 PM
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.
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.