It's not a secret anymore!
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to validate" Watch "how to validate" New topic

how to validate


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>
<td><html:checkbox property="mandatory" style="margin-left: 15px"/></td>
When i select CheckBox From Option value i want my checkBox Should be disabled else enable.
How to do this.Please help...
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33119

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2

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.

Consultant, Sima Solutions

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

I solve this one by using javascript nchange();
I agree. Here's the link:
subject: how to validate
It's not a secret anymore!