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 Struts Validator Framework: client-side problem with submitting buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validator Framework: client-side problem with submitting buttons" Watch "Struts Validator Framework: client-side problem with submitting buttons" New topic
Author

Struts Validator Framework: client-side problem with submitting buttons

Michele Giunti
Greenhorn

Joined: Jun 02, 2008
Posts: 12
Hi, I'm using Struts Validator Framework (Struts 1.3).
Server-side validation works well.
The problem is in client-side validation.

The form name I have to validate is: RegistrazioneUtenteForm.

In my jsp page I have 2 buttons:
1)
2)
and the following form declaration:

Moreover I have enabled javascript validation:


The javascript function submitRegistrazioneUtenteForm is the following:


If I click on the second button (html:submit), all works well (I get javascript alerts).
If I click on the first button (html:link), the form is submitted but I can't see any javascript alerts.

I can't understand where is the problem.

Can you help me?

Thanks in advance.

PS: I have underscored the javascript e_v_a_l function only to be allowed to post in this forum. In my code, it's not underscored.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm not entirely sure, but I suspect the problem may be with the fact that you're using an eval to submit the form. I'd suggest you try doing a normal JavaScript submit without the eval.


Merrill
Consultant, Sima Solutions
Michele Giunti
Greenhorn

Joined: Jun 02, 2008
Posts: 12
I tried your suggestion with:

but the result is the same. The form is submitted but I can't see any javascript alerts.

I can't understand where is the problem.

Suggestions?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Validator Framework: client-side problem with submitting buttons
 
Similar Threads
Why this client side javascript is not enabled?
Cancel button and bypassing JavaScript validation
problem using validator framework with DispatchAction
Validation failure
incompatible: File Upload + Validator Client side JS