This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Checkbox issue  RSS feed

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My jsp page has 5 checkboxes and a submit button which performs an action and loads the same jsp pasge again. Issue is that after checking(say 3 checkboxes) and submitting the form the checkboxes remain checked. How do I clecr the checkboxes after submitting the form?
 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds strange to me, since once the page refreshes, the checkboxes should return to their original state, unless of course your code directs them otherwise.

Anyhow, you can check and uncheck any checkbox via javascript by accessing the checked attribute. The checked attribute can assume a value of true or false.

Example:


The above code will uncheck the checkbox whose id = "checkBox1".
[ May 26, 2004: Message edited by: Jeffrey Hunter ]
 
Author and ninkuma
Marshal
Posts: 66609
161
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!