This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

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
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();
 
Have you checked out Aspose?
 
subject: how to validate
 
It's not a secret anymore!