File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Checkbox issue Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Checkbox issue" Watch "Checkbox issue" New topic
Author

Checkbox issue

Nicolas Flammel
Ranch Hand

Joined: May 05, 2004
Posts: 32
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?
Jeffrey Hunter
Ranch Hand

Joined: Apr 16, 2004
Posts: 305
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 ]
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50679

Moving to the HTML/Javascript forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
IntelliJ Java IDE
 
subject: Checkbox issue
 
Threads others viewed
how to call JSP from Servlet
parameter value should be null
Convert Chinese Name to english name in JSP page
checkboxes persistence
URL rewriting
IntelliJ Java IDE