Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client Side Custom Validation

 
dimpsonu arora
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic