• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Checkbox on show div tag when the page is loaded

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

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.

with regards,
Bhargavi.
 
Ranch Hand
Posts: 72
Scala Monad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lets say you have a form bean with this getters and setters,



in JSP,


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.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Hang a left on main. Then read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic