Posted By:
Aaron_Keane
Posted On:
Friday, October 19, 2001 12:30 AM
Hi,
this is something that I have validating a form, I'm sure that it could be done better (rush job) but it works!!
The function is called isSelected(), and you can see all the names of my form fields in the
if statement.
My else statement (which is not pasted here) passes the focus to another function which validates the email address entered and then submits the form.
Hope that this is of some use.
function isSelected()
{
if ((purDetail.fname.value.length == 0)
||(purDetail.lname.value.length == 0)||
(purDetail.email.value.length == 0)||
(purDetail.email1.value.length == 0)||
(purDetail.add1.value.length == 0)||
(purDetail.city.value.length == 0)||
(purDetail.country.value.length == 0)||
(purDetail.ccnum.value.length == 0)||
(purDetail.recip.value.length == 0)||
(purDetail.phone.value.length == 0))
{
alert("Please ensure that you entered data in all fields marked ' * '.");
}
Aaron