Hi
Sorry I am posting again. I am trying to make a web form for my new website. I am doing the coding myself because I cannot afford to hire a coder for me. I need some help from you. Please forgive me for all my idiotic questions!
Now, here's the problem. In my web form I am using JavaScript alert system to check for Required fields. But the problem is, its been checking text boxes without any problem, but for Questions with Radio buttons, its not checking! My code is:
if (frm.Gender.value == "") {alert('Please mention your gender.');frm.Gender.focus();return false;}
if (frm.ID.value == "") {alert('ID is required.');frm.ID.focus();return false;}
So it is giving alert message if the ID field is kept blank but it does not work when Gender field is kept blank but both of them are actually required fields.
My HTML code for Gender and ID:
<td><b>Gender*:</b></td>
<td><input id="Male" name="Gender" type="radio" >Male<br/>
<input id="Female" name="Gender" type="radio">Female</td>
</tr>
<td><b>Please mention your ID*:</b></td>
<td><input id="ID" name="ID" type="text" maxlength="17" style="width:300px; border:1px solid #999999" /></td>
</tr><tr>
Could you please tell whats wrong here?
Sorry I am amking this long but I have one more question. This form gets mailed to me when user fills the required fields and captcha.
Problem is I am getting my email but the radio fields are coming as "ON"! Suppose, If the user choice was for Gender Male, its giving me "Gender = on", but I need actually Gender=Male. I have also options with three radio buttons and even those are coming as "ON". Any solution for this?
Thanks