Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to enable check box on select particular value from dropdown box

 
zimbu bolleddu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I�m new to the struts, how to enable (make visible) a check box on selecting a particular value from Drop down list in jsp.

Thanks in advance.

Regards,
Zimbu
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey you can use a javascript function call to disable or enable the
checkbox onchange of the dropdown
 
zimbu bolleddu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply,
But I unable to do that, and one more thing is I'm using struts layouts package.

would you give me a sample code snippet.
 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can write in javascript function
that is assign styleid for the textfield you want and then place following cod e in your javascript

document.getElementById("callno").value="";
document.getElementById("callno").disabled=false;
 
zimbu bolleddu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply .. .

But even though Im not getting output,

And here is my code :

here is javascript :

document.getElementById("somevalue").disabled=false;

jsp tag :

layout:checkbox key="leave.sick" property="sick" styleId="somevalue"

where property is sick is boolean (bean) type.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic