![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I'm new to javascript and I want to validate the fields in a html form. I have written a function to validate my radiobuttons but it seems it doesn't work. First I put the form output in a var using : document.getElementById Than make a functioncall in a nested loop to check all my fields in a form. The radiobutton check gives an error. It seems that elem.lengt does not gives the lenght of the array? Putting an alert(elem.length); to check the output gives 'undefined' message. What goes wrong? var gender = document.getElementById('gender'); ...... if(isNumeric(age, "Please enter your age")){ if(isRadio(gender, "Please select a gender")){ .... //this is the validation function function isRadio(elem, helperMsg){ |
#3
| |||
| |||
|
|
I'm new to javascript and I want to validate the fields in a html form. I have written a function to validate my radiobuttons but it seems it doesn't work. |
![]() |
| Thread Tools | |
| Display Modes | |
| |