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 Struts heighlighting error field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts heighlighting error field" Watch "Struts heighlighting error field" New topic
Author

Struts heighlighting error field

Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
Hi,

I am trying to change field color on error occur to a particular field. But i m not able to do it.I try to use errorStyleClass and errorStyle as well bt it giving me an error as This attribute is not recognized.

I am using struts 1.2.................

Please help me out for this....

Thanks in advance.
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
Hi,
Please help me out for this.........I am waiting from last 3 days..........

Thanks.
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
oops.........not even a single reply yet....???
Ok....!!!
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

Hope this will help


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
Thanks a lot for your reply........bt its nt working.....
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

What is your code and what error you are getting?
Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
I am working on change password screen. And I am using from validation via validate method into changePasswordBean
Please refer code below of changePassword.jsp page

<struts_html:html>
<body>
<table cellpadding="0" cellspacing="0" border="0" class="nav-table"
width="350">
<tr>
<td class="content">
<h1 class="h1">
<struts_bean:message key="login.link.changePassword" />
</h1></td>
</tr>
</table>
<struts_html:form action="saveChangedPassword.do"
name="changePasswordForm" type="com.otto.lisa.web.ChangePasswordForm"
method="POST" scope="request">
<table cellpadding="0" cellspacing="0" width="350">
<tr>
<td nowrap="nowrap"
style="text-align: right"><struts_bean:message
key="lisa.changepassword.label.username" /></td>
<td><struts_html:text value=""
name="changePasswordForm" tabindex="4" maxlength="15"
property="username" style="error-field"></struts_html:text>
</td>
<td><img width="20" alt="" height="20"
src="gfx/QuestionmarkButton-16x16.png" border="0"
style="cursor: help" title="Username is required." /></td>
</tr>
<tr>
<td nowrap="nowrap"
style="text-align: right"><struts_bean:message
key="lisa.changepassword.label.oldPassword" />
</td>
<td><struts_html:password value=""
name="changePasswordForm" tabindex="4" maxlength="15"
property="oldPassword">

</struts_html:password>
</td>
<td><img width="20" alt="" height="20"
src="gfx/QuestionmarkButton-16x16.png" border="0"
style="cursor: help;" title="Old Password is required." /></td>
</tr>
<tr>
<td nowrap="nowrap"
style="text-align: right"><struts_bean:message
key="lisa.changepassword.label.newPassword" />
</td>
<td><struts_html:password value=""
name="changePasswordForm" tabindex="4" maxlength="15"
property="newPassword"></struts_html:password></td>
<td><img width="20" alt="" height="20"
style="cursor: help" src="gfx/QuestionmarkButton-16x16.png"
border="0"
title="Password should be secure: minimum 8 characters, at least 1 uppercase letter, at least 1 lowercase letter, at least 1 number and at least 1 special character." />
</td>
</tr>
<tr>
<td nowrap="nowrap" style="text-align: right"><struts_bean:message key="lisa.changepassword.label.confirmPassword" />
</td>
<td><struts_html:password value=""
name="changePasswordForm" tabindex="4" maxlength="15"
property="confirmPassword"></struts_html:password>
</td>
<td><img width="20" alt="" height="20"
src="gfx/QuestionmarkButton-16x16.png" border="0"
style="cursor: help"
title="New password and confirm password should be same." /></td>
</tr>
<tr>
<td><struts_html:submit
property="submitForm"
style="width: 60px; text-align: center; height:25px">
<struts_bean:message key="lisa.changepassword.button.submit" />
</struts_html:submit></td>
<td><struts_html:reset property="resetForm" style="width : 60px; text-align: center; height:25px">
<struts_bean:message key="lisa.changepassword.button.reset" />
</struts_html:reset>   <struts_html:reset property="cancelForm"
onclick="window.close();"
style="width : 60px; text-align: center; height:25px">
<struts_bean:message key="lisa.changepassword.button.cancel" />
</struts_html:reset></td>

</tr>
<tr>
<td colspan="3" class="error" align="left"></br> <struts_html:errors
property="username" property="oldPassword" property="newPassword"
property="confirmPassword" /> <struts_html:errors
property="securepassword" /> <struts_html:errors
property="matchpassword" /></td>
</tr>
</table>
</struts_html:form>
</body>
</struts_html:html>

I am trying to change field color on error occur to a particular field. But i m not able to do it.I try to use errorStyleClass and errorStyle as well bt it giving me an error as This attribute is not recognized.



Dipali yadav
Greenhorn

Joined: May 21, 2012
Posts: 22
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts heighlighting error field
 
Similar Threads
How to focus on error field
Validation Framework Error in Struts
Error in validation by using validation framework
New one in struts
Validation Form Error Message Location