This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes how to validate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to validate" Watch "how to validate" New topic
Author

how to validate

Raj
Greenhorn

Joined: Dec 05, 2007
Posts: 17
Hello All experts,
Here is my code:

<html:select style="margin-left: 15px; width: 120px" property="type" >
<html ption value="<%="" + P.FieldType._FIELD_TEXT %>">Text</html ption>
<html ption value="<%="" + P.FieldType._FIELD_INTEGER%>">Number</html ption>
<html ption value="<%="" + P.FieldType._FIELD_FLOAT %>">Fraction</html ption>
<html ption value="<%="" + P.FieldType._FIELD_DATE %>">Date</html ption>
<html ption value="<%="" + P.FieldType._FIELD_TIME %>">Time</html ption>
<html ption value="<%="" + P.FieldType._FIELD_DATETIME%>">DateTime</html ption>
<html ption value="<%="" + P.FieldType._FIELD_CHECKBOX %>">CheckBox</html ption>
<html ption value="<%="" + P.FieldType._FIELD_POPUP >">Popup</html ption>
</html:select>
<tr>
<td><html:checkbox property="mandatory" style="margin-left: 15px"/></td>
</tr>
When i select CheckBox From Option value i want my checkBox Should be disabled else enable.
How to do this.Please help...
Thanks,
Rama.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

You want this to happen when you first load the JSP (struts) or when the user changes something (Javascript) ?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Raj
Greenhorn

Joined: Dec 05, 2007
Posts: 17
Hello expert,
Thanks For Reply .I want this when user change option value(Java Script).
thanks rama.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You will want to use the onchange event of your select element to call javaScript code that will either enable or disable the checkbox based on the value of the selected option.


Merrill
Consultant, Sima Solutions
Raj
Greenhorn

Joined: Dec 05, 2007
Posts: 17
Thanks Maril !

I solve this one by using javascript nchange();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to validate
 
Similar Threads
How to enable and disable a dropdown list.
HTML:SELECT
html:select - maintain incoming value in drop down box
passing two arrays to Javascript function
html:select in Struts