Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Radio Buttons invalidating Validation code
desWork
Junior Member

Posts: 2
Registered: 7/25/2005
Member Is Offline
posted on 7/25/2005 at 04:24 PM Reply With Quote
Radio Buttons invalidating Validation code


Hi there
I have incorporated the Tigra Validation code into a form I am hosting on a website. I'm having trouble with the radio buttons included in my form and validation script. If I select a radio option but don't fill in any of the other required fields it is still possible to submit the form. Obviously I want all my required fields to be filled in before the user can post it.

HTML Code:

<td valign="top" id="t_requirements">
Requirements*
</td>
<td valign="top">
<table width="350">
<tr>
<td valign="top"><label>
<input type="radio" name="RadioGroup1" value="Specifications Only">
Specifications only</label>
</td>
</tr>
<tr>
<td valign="top"><label>
<input type="radio" name="RadioGroup1" value="Specifications And Sample">
Specifications &amp; sample</label>
</td>
</tr>
<tr>
<td valign="top"><label>
<input type="radio" name="RadioGroup1" value="Other">
Other <span class="greyText">(please specify in 'Other Requirements' box)</span></label><br /><br />
</td>
</tr>
</table> </p>
</td>


JavaScript in the body tags:

'RadioGroup1' : {'l':'Requirements','r':true,'f':'radiobutton','t':'t_requirements'},


VBScript in the ASP file:

& "REQUIREMENTS: " & Request.Form("RadioGroup1") &


This is a real head scratcher for me so your thoughts would be warmly received.
View User's Profile View All Posts By User U2U Member
lamojo
Newbie

Posts: 1
Registered: 3/13/2008
Member Is Offline
posted on 3/13/2008 at 12:26 PM Reply With Quote
tigra form validator and radio buttons


hi! i solved this with javascript and an extra hidden field

in the example above i would add:

<input type="hidden" id="RadioGroup1Selected" name="RadioGroup1Selected" value="">

and add javascript to the radio buttons:

<input type="radio" name="RadioGroup1" value="Specifications And Sample" onchange="document.getElementById('RadioGroup1Selected').value='true';" >


and then require the field 'RadioGroup1Selected' in the validation


a little late for desWork, but other developers might accidentally stumble upon this solution thru this primitive search engine called Google :)
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Product Page
Product Demonstrations Product Demos
Registration Form Validation
Login Form Validation
Free Download Free Download
Product Documentation Documentation
Documenation Page
Change Log
Validators Comparison Table
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004