| Author |
test not working well for radio button when I have 1 element of list
|
Kyupa Supa
Ranch Hand
Joined: Jun 23, 2012
Posts: 30
|
|
A list of courses is displayed and user has to select 1, so I used radio buttons. The course list vary from one student to another.
If I have more than 1 courses displayed and user selects one, everything is ok, but if I display 1 course, the test is JavaScript seems to not be right...
Validate if radio button(a course) was checked:
If I have 1 course, ok = 1 (due to textbox(es) only, ignoring the selected course). ok = 2 so the form will be submitted
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
The way way back machine has a solution: http://www.coderanch.com/t/115796/HTML-CSS-JavaScript/inconsistency-radiobutton
Eric
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
|
Or use jQuery and forget about inconsistencies.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: test not working well for radio button when I have 1 element of list
|
|
|