File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Unexpected behavior of Validator's Java Script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unexpected behavior of Validator Watch "Unexpected behavior of Validator New topic

Unexpected behavior of Validator's Java Script

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
During development of a Struts based wizard-app I encountered very strange behavior of Validator's JavaScript.
Lost almost whole night trying to figure out what is goin' on.?

Here is description of the problem:

JSP page:
<html:javascript formName="appForm" />
<html:form action="" onsubmit="return validateAppForm(this)" >
<html:hidden property="page" value="1" />
<html:text property="proba" value="" />

<form name="appForm">
<field property="proba" page="1" depends="required,integer">
<arg0 key="resources.error.proba" />

Server-side validation runs OK, but client-side validation doesn't occur at all?
I have figured out why is that happening, but currently have no solution. Here lies the problem:
In order to force client-side validation "page" attribute should be removed from the <field> tag in validation.xml file.
In that case everything runs OK but there is no wizard style of my app.

Is it a bug in the Validator framework, or I'm doing somethig wrong?
Have You any solution?
I agree. Here's the link:
subject: Unexpected behavior of Validator's Java Script
It's not a secret anymore!