• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Struts+JavaScript validation

 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing Struts_1.1 based wizard application starting from page=1.
I set appropriate validation requirements in validations.xml.
Server-side validaton works OK, but JavaScript validation doesn't occur at all.
JavaScript validation would work, but I have to rewrite my application to start from page=0; Even than, validation would work only for the first step (page=0).

What is going on?
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript validation would work, but I have to rewrite my application to start from page=0; Even than, validation would work only for the first step (page=0).


Why do you say that?
Are you doing the following (assuming you are using the page number approach, one form bean containing all pages' fields)?
1. hidden control which specifies the page number
<html:hidden property="page" value="1"/>
2. Use "page" attribute for each "field" in the validation.xml to specify the page number on which the field belongs.

Alternately you could use ValidatorActionForm for multi-page forms.

Sheldon Fernandes
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I'm using all of that.
I also use page property of my ValidatorActionForm bean in its reset method.
Maybe it is some bug in the Struts release I have.
I'm using Struts release packed with examples that can be found on the CD shipped with the book "Struts in action".

Could someone give me a link to the latest release of Struts 1.1?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Could someone give me a link to the latest release of Struts 1.1?


You can download Struts 1.1 final release at here:
http://www.apache.org/dist/jakarta/struts/binaries/

Nick
[ November 09, 2004: Message edited by: Nicholas Cheung ]
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition, you might also be interested in upgrading Struts to 1.2.4.
http://struts.apache.org/download.cgi

Nick
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any tutorial/article on how to migrate from Struts 1.1 to Struts 1.2?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic