Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

test not working well for radio button when I have 1 element of list

 
Kyupa Supa
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or use jQuery and forget about inconsistencies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic