Help coderanch get a
new server
by contributing to the fundraiser
  • 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Struts2JQuery plugin-- displaying error messages

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

My requirement is when a text field loss focus i need to send its content to an action. Action will validate its value against a schema.
If it is a valid input then sends 1 as a replay else 0.

I want to call action through jquery. In struts by default if we submit a form with invalid data then error message will be displayed in red color text above the text field.

I want to get the same effect when i validate using jquery as i said above. When i get response 0 from action to jquery function then i need to display error message at the bottom of the text field. I am using struts2jquery plugin.

Need advice on how to do this in a proper way.


Thanks
Peter
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you seen the validation examples in the struts2 jquery showcase?

See Ajax Forms / Validation!

How it works is explained in the Struts2 jQuery Wiki - Validation.

Johannes
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, thanks. will check.
 
reply
    Bookmark Topic Watch Topic
  • New Topic