• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Struts Validator Framework: client-side problem with submitting buttons

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michele Giunti
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Goodbye moon men. Hello tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!