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 help please.
shadiadiph
Junior Member

Posts: 2
Registered: 3/25/2008
Location: Thailand
Member Is Offline
posted on 3/26/2008 at 04:37 AM Reply With Quote
radio buttons help please.


I am using the validator.js however I can't seem to work out a way to do this.
I have a form page that has a question with two radios with the values yes and no if yes is selected then a text input is required in a text field input if no is selected them it is not required. Does anyone have any ideas on how to use the validator.js to do this?

Thank you
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/26/2008 at 03:05 PM Reply With Quote

if you replace value 'no' with the empty string ''
then you should be able to use 'r' (required) key to make sure 'yes' is selected.
You can also use checkbox in this case.
View User's Profile View All Posts By User U2U Member
shadiadiph
Junior Member

Posts: 2
Registered: 3/25/2008
Location: Thailand
Member Is Offline
posted on 3/27/2008 at 05:14 PM Reply With Quote
hi tigra


thanks i will try that and let you know how i get on.

is there anyway to make the 'alphanum': /^\w+$/, work so it will accept spaces?

thank you
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/27/2008 at 05:30 PM Reply With Quote

you can just add another type to the list, say:

'alphanumspace': /^[\w\s]+$/,
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