aspose file tools*
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 Spring in Action this week in the Spring 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: 120
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: 120
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: 61424
    
  67

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]
 
wood burning stoves
 
subject: How to retain the selected checkbox after form load?