i am using an onclick event to check the checked state of a checkbox and appropriately update a global js variable with the value and while submitting i want to append this global js variable to the <blockquote>code:<pre name="code" class="core"><%= someProperty%></pre></blockquote> variable. Later on when rendering the form, i would just check the presence of the global variable in the property and make the box as checked.
thanks in advance for reading such a long post. appreciate that.
I am setting the "checked" property of the checked checkboxes through a script at the time of submitting the form. Still i am unable to view them as checked when the form is redisplayed after saving. i just want to view the boxes that were checked, not worried about the unchecked ones.
Setting the attribute on the page before they are displayed won't automatically do anything for making them checked on the current page. You must set the checked attribute for all checkboxes that you want checked on the current page.
If you are using JSP this is easy to do. Just look at which checkboxes were checked on the way in, and make sure that those checkboxes have the checked attribute when you generate them for the current page.