• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

null values diplays in Client Side 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 getting one problem while using java script validations from validator frame work. I am giving validation to all field. while giving alert message when user not entered any values it displays "null is required" for all the fields, but we want to display particular field name is required(Ex. User Name is required).

my validate.xml form is
<formset>
<form name="CustomerFormMediator">

<field property="userName" depends="required">
<argo name="required" key="User Name" resource="false"/>
</field>
<field property="email" depends="required">
<argo name="required" key="email" resource="false"/>
</field>
</form>
</formset>

my jsp form is as follows

<b>username:</b> <html:text property="userName"/><br>
<b>email:</b> <html:text property="email"/><br>

please try to find my mistake i tried very much but i failed...please help me

Thanking you in advance.
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
key attribute of argX is suppose to be an entry in struts application resource property. I see "User Name" which can't be a valid key as it contains a blank space. Check this URL to get clear idea of client-side validation .
http://www.roseindia.net/struts/address_struts_validator.shtml
[ September 07, 2006: Message edited by: Purushothaman Thambu ]
 
Praveen Reddy
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Purushothaman

the way which you said also tried but i am getting same errors"null is required"

my validate.xml form is
<formset>
<form name="CustomerFormMediator">

<field property="userName" depends="required">
<argo name="required" key="userName" resource="false"/>
</field>
<field property="email" depends="required">
<argo name="required" key="email" resource="false"/>
</field>
</form>
</formset>

my jsp form is as follows

<b>username:</b> <html:text property="userName"/><br>
<b>email:</b> <html:text property="email"/><br>
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You missed the crux of the previous message. What do you have in message resource bundle? Struts is not able to map the key value "userName" to any entry in the resource file.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic