This is a discussion on "Radio Buttons and Javascript" within the JavaScript Forum section. This forum, and the thread "Radio Buttons and Javascript are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Radio Buttons and Javascript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Radio Buttons and Javascript
Hi I have the following form:
I have the validation script ok, but its figuring out which radio button has been selected that is not working for me... Any ideas/help would be great.
Nathan Last edited by Rakuli; Dec 11th, 2007 at 10:22. Reason: Added [html][/html] tags |
|
|
|
#2
|
||||
|
||||
|
Re: Radio Buttons and Javascript
So it appears you have a script there that at a quick glance does the trick. Are you having a problem with this?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#3
|
|||
|
|||
|
Re: Radio Buttons and Javascript
Hi no matter which radio button i chooses it always performs the first if statement.
Regards |
|
#4
|
|||
|
|||
|
Re: Radio Buttons and Javascript
And i get a javascript error:
Line 212 Char 5 Error: 'user_input is undefined' Code 0 |
|
#5
|
||||
|
||||
|
Re: Radio Buttons and Javascript
Try cleaning up the code a little
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#6
|
|||
|
|||
|
Re: Radio Buttons and Javascript
With your code i get
Error: Expected '}' which i thought should be here: for (i=0;i<pageFormElements.length;i++) { if (pageFormElements[i].name == 'search_type' && pageFormElements[i].checked) { user_input = pageFormElements[i].value; } } But when i add that i still get Error: Expected '}' Regards |
|
#7
|
||||
|
||||
|
Re: Radio Buttons and Javascript
I have a typo, change swicth to switch
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Help with Radio buttons | Oak | JavaScript Forum | 17 | Feb 2nd, 2008 09:44 |
| How do i submit a form with radio buttons ? | Accurax | Web Page Design | 5 | May 12th, 2007 18:34 |
| Radio buttons and mandatory fields | joshcxa | JavaScript Forum | 1 | Aug 8th, 2006 10:30 |
| help with pagination and html radio buttons | AdRock | PHP Forum | 5 | Jul 27th, 2006 12:10 |
| Radio Buttons | redhead | Web Page Design | 2 | Apr 12th, 2004 19:00 |