wood burning stoves 2.0*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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