It's not a secret anymore!
The moose likes Struts and the fly likes How to enable check box on select particular value from dropdown box Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "How to enable check box on select particular value from dropdown box" Watch "How to enable check box on select particular value from dropdown box" New topic
Author

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

zimbu bolleddu
Ranch Hand

Joined: Jan 14, 2008
Posts: 35
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

Joined: May 12, 2008
Posts: 224
Hey you can use a javascript function call to disable or enable the
checkbox onchange of the dropdown


Regards, Vijay Jamadade.
( Nothing is Impossible.)
zimbu bolleddu
Ranch Hand

Joined: Jan 14, 2008
Posts: 35
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

Joined: May 12, 2008
Posts: 224
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

Joined: Jan 14, 2008
Posts: 35
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.
 
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: How to enable check box on select particular value from dropdown box
 
Similar Threads
jsp file with java script error?
how to select a row datatable
how to fetch values from message bean
Enable button from multiple input fields
how to get multiple value from