I have a check box and the information of if it is checked or not, comes from Actionform get, I want the div tag to be displayed when the jsp is first loaded and the check box is checked, and the inforamtion of it I get from Action-dao-bean.
I am using logic:iterator and getting the value and property form bean
Can some one help me in sending the sample code for this.
It is checking for the property 'symbol' in bean, if it is 'Y' then 'checked' attribute is included in the checkbox control. If it is other than 'Y', then it is not checked.
Hope it helps.
- Marimuthu Madasamy
Brent Sterling
Ranch Hand
Joined: Feb 08, 2006
Posts: 948
posted
0
It sounds like you have a situation where if a checkbox is checked then you need to show some additional fields and when the checkbox is cleared you need to hide some additional fields. Is this correct? Do you already have JavaScript code in place to do this at runtime?
To set the state when the page if first shown you can do one of two things. You could use scriptlet code or custom tags in your JSP to create the fields you need in the desired state. The other option is to call your JavaScript function when the page loads. The benefit of using JavaScript is that you don't have to implement the logic twice.
- Brent
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Checkbox on show div tag when the page is loaded