Helllo everyone, I have the following form and accompanying JavaScript setup but can not seem to get it to work.
Here is what I have:
I am not getting an error when the radios area not checked and it will let the user continue to the next page.Code:<script type="text/javascript"> function ValidateEventForm() { btnChecked = false; for (i=0; i<document.EventForm[0].pass.length; i++)//get number of buttons in the group { if (document.EventForm[0].pass[i].checked) btnChecked = true; //see if current button is checked } if (!btnChecked) { alert("Please select a Type of Expo Pass."); return false; } btnChecked = false; for (i=0; i<document.EventForm[0].d1_am.length; i++)//get number of buttons in the group { if (document.EventForm[0].d1_am[i].checked) btnChecked = true; //see if current button is checked } if (!btnChecked) { alert("Please select a Day 1 Morning Session Tract."); return false; } } </script> <form action="https://www.homex2007.com/register-confirm.php" method="post" name="EventForm" onSubmit="return ValidateEventForm();"> <td width="29%" colspan="2" style=" border-bottom: 1px solid #000000; "><p><strong>Regular Pricing <br> After Jan. 15, 2007</strong></p></td> </tr> <tr> <td><br><p><strong> <input name="pass" type="radio" value="1 Day Pass" onClick="selected"> One-day Pass</strong></p></td> <td><br><p><strong> $250.00</strong></p></td> <td colspan="2"><br><p><strong> $350.00</strong></p></td> </tr> <tr> <td><p style="padding-top:3px; "><strong> <input name="pass" type="radio" value="2 Day Pass" onClick="selected"> Two-day Pass</strong></p></td> <td><p><strong>$375.00</strong> </p></td> <td colspan="2"><p><strong>$475.00</strong></p></td> </tr> <tr> <td colspan="4"><br><p>One & Two day passes include Continental Breakfast, Lunch on Expo Floor, access to all Summit & Keynote Sessions, Expo Floor, Welcome Cocktail Reception and After Party at the Aquarium of the Pacific., You may register to attend all non-hosted events.</p></td> </tr> <tr> <td><br><p><strong> <input name="pass" type="radio" value="Expo Only" onClick="selected"> Expo Only Pass</strong></p></td> <td><br> <p><strong> $75.00</strong></p></td> <td colspan="2"><br> <p><strong> $100.00</strong></p></td> </tr> <tr> <td colspan="4"><p>Expo Pass includes access to Expo Floor <strong>ONLY</strong> for both days.</p></td>
Any help would be awesome!!
Rob





Bookmarks