• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Why this client side javascript is not enabled?

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using validator framework, the server side validations are working fine and displaying error messages properly.

Now I want to eable client side validations and want to diplay error messages as popup alerts. For this I have done these things in my jsp..

First I have added this line:


I have also added 'onsubmit' to my form tag:


on top of the jsp in between html head tag I have added this entry:


Now the error messages are not getting displayed as popup alerts messages at client side.

Pls tell me what might be the problem ?

Thanks.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not have two <html:javaScript> tags in your JSP. Only one. The first one you listed should suffice.

Also, make sure hat you specify validate="true" in your Action mapping.
 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merrill,

Thanks for your reply.

As you suggested I have deleted the second <html:javascript> tag.
In my action mapping in struts-config.xml I am having the entry validate="true" .

Still its not working.

Pls suggest me in this regard.

Thanks.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting <html:errors/> in your JSP

-- David
 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,

Already I have written this in my JSP, still its not working.

what might be the problem?
 
David Dhune
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try following things, see if it works,

1. Use <html:javascript formName="BasicInfoActionForm"/> and remove the other one from your JSP.
2. On the browser, right click and do "View Source" and try to search validateBasicInfoActionForm, and see it exactly matches with the function name and crosscheck formName also, formName="BasicInfoActionForm".
3. If it still not works, you may try html:form

-- David
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic