This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes How to retain the selected checkbox after form load? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to retain the selected checkbox after form load?" Watch "How to retain the selected checkbox after form load?" New topic
Author

How to retain the selected checkbox after form load?

prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 118
Hi Members,

Im having some bunch of check boxes and im selecting few in that and after form loads i can get the value of the selected check box, but the selected one is seen unselected after form loads, im not sure what im doing wrong..... I need the selected check box to be selected after form loads...

Please help me in this...........

Looking forward for your reply...

Regards,
Prabhu.
[ July 24, 2008: Message edited by: Bear Bibeault ]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Please clarify to me, what is mean by 'form load' , is it mean that when page load or when you submit the form !

and post your <form> code and action/servlet who processing it !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 118
Hi Sagar,

Great to meet you here.

Sorry it is page load(when i click the submit button ... struts action )
And i could not post my code as it is huge, but my requirement is, im having some check box and im selecting some check box in it and after page load or page submit i have to show the selected check box again using javascript function.

Please reply me if you are not clear with my reply...

Regards,
Prabhu.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

As was posted in the other topic on this issue, your JSP needs to set the following attribute:



on the checkboxes that are to be checked.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to retain the selected checkbox after form load?
 
Similar Threads
Sending email using javascript
display in Jsp
submit form problem
Keep the combobox entries after the form submission
selecting an option in a select box from session variable