File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Why this client side javascript is not enabled? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Why this client side javascript is not enabled?" Watch "Why this client side javascript is not enabled?" New topic
Author

Why this client side javascript is not enabled?

Ja vardhan
Ranch Hand

Joined: May 09, 2005
Posts: 169
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.


Javardhan:
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
Ja vardhan
Ranch Hand

Joined: May 09, 2005
Posts: 169
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.
David Dhune
Greenhorn

Joined: Sep 28, 2006
Posts: 14
Try putting <html:errors/> in your JSP

-- David
Ja vardhan
Ranch Hand

Joined: May 09, 2005
Posts: 169
David,

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

what might be the problem?
David Dhune
Greenhorn

Joined: Sep 28, 2006
Posts: 14
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why this client side javascript is not enabled?