Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
04-26-2009, 03:41 PM #1
- Join Date
- Apr 2009
- Thanked 0 Times in 0 Posts
field validation in a seperated js file
say i need to validate the second field, if the first field is filled 'yes' from(yes/no) combo box(SELECT), then the second filed should be filled with some value, and then the user should not be allowed to fill other
fields until he fills the second field, as the user tries to bring focus on any other fields he should be prompted with alert message and then the focus should be back to second field.
Below is the script i wrote, but the issue is i need to call the CheckFiled() function for all the fields avilable in the form, i tried writing onfocus="CheckFiled()" for all the fields in the form.
My question is how can we generalise this function?
if(document.Form1.Field1.value == "1")
if(document.Form1.Field2.value == "")
alert(" Fill Value in ipAddress");