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 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: 31076
    
233

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();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to validate