Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Client Side Custom Validation

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic