Regd: How to identify which field name in java script corresponds to which field on the form.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   bobby_reddy
Posted On:   Sunday, November 25, 2007 10:05 PM

Hello everyone,

I have a javascript code for few elements (function onSave(form)). I need to check not null validation for one field i.e., it should display an alert box ("Student field should not be null")if that field is empty when the user who uses the form tries to save without entering a value. Is there any way that can determine which field (for example field1)corresponds to which field (for example student field)if there are many fields on the form.

As I am new to java script, could any one guide me where I can find pdf files of Java Script so that I can master the concepts of it?

Thanks,
Bobby.

Re: Regd: How to identify which field name in java script corresponds to which field on the form.

Posted By:   Anonymous  
Posted On:   Monday, November 26, 2007 01:29 AM

hi,

First you will get all the form elements by
document.forms[0].elements which returns news array object and validate with each fields as null and through alert statement when null element encountered.

You can go thru the url for tutorial

http://www.openjs.com/tutorials/advanced_tutorial/forms.php
About | Sitemap | Contact