aspose file tools*
The moose likes Struts and the fly likes Client Side Custom Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Client Side Custom Validation" Watch "Client Side Custom Validation" New topic
Author

Client Side Custom Validation

dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
Hi,
I am having a form with some text fields. I am using predefined as well as my custom validations on this form.
I need the client side java script validations. So, I am using...

<html-el:messages id="msg" message="true"><li><font color="red"><c ut value="${msg}"/></font></li></html-el:messages>
<html-el:errors />
<html-el:form action="ItemTypeCRUD" onsubmit="return validateItemTypeCRUDForm(this);">

<html-el:javascript formName="ItemTypeCRUDForm"/>

</html-el:form>

Now, The problem is that all the predefined validations like "required,mask" are displayed as an "Alert" as is the case in javascript(Which I want). But my custom validations are getting printed on
the screen.
What should i do to display my custom validations as an "Alert".

Thanks in Advance.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I do not use client side validations, but my understanding is that you would have to write JavaScript code to implement your custom validation rule and add that JavaScript to your validator-rules.xml file. Have you done this?

- Brent
dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
Hi,
Yes I have done this and my customize validation is working fine. The only problem is that it is printing message on the screen. But I want it to be appeared as an alert as is the case of normal javascript.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client Side Custom Validation
 
Similar Threads
Why this client side javascript is not enabled?
Form Level Error Messages In JSF
client side validation in struts
Struts Validator Configuration
validator framework