File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
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: 235
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: 235
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://aspose.com/file-tools
 
subject: How to enable check box on select particular value from dropdown box
 
Similar Threads
how to get multiple value from
Enable button from multiple input fields
how to fetch values from message bean
jsp file with java script error?
how to select a row datatable