You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Berke, Wayne [IT]" <wa...@citigroup.com> on 2004/04/20 18:26:59 UTC

Multiple ActionForms on a page - client side validation possible?

Hi,

I have a page that logically subdivides into 3 independent HTML forms and I've subsequently planned on using 3 different ValidatorForms for each.  There seems to be no problem in configuring validations for each form's fields and having those validations trigger from the server side.  However, I seem to be running into problems when trying to activiate client side validation via multiple html:javascript tags.  To simplify things, I've only configured two ActionForms each of which has a property that uses the "required" validator.  The tags in my JSP (in the HTML <head>) look like this:

	<html:javascript formName="form1" staticJavascript="false" dynamicJavascript="true" />
	<html:javascript formName="form2" staticJavascript="false" dynamicJavascript="true" />
	<html:javascript formName="form1" staticJavascript="true" dynamicJavascript="false" />

The problem seems to be that each of the dynamic JS tags emits a required() method that is not name-specific to its form.  This results in the second such definition being the only one that is visible from the entire page.  Therefore, the form2 does correctly perform client-side validation for its required field whereas form1 does not.

Is there a correct way to make this work?  Merging everything into one big unwieldy form would work, but would make the data structures unmanageable.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple ActionForms on a page - client side validation possible?

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
http://issues.apache.org/bugzilla/show_bug.cgi?id=17667

try the latest nightly build.

Niall

----- Original Message ----- 
From: "Berke, Wayne [IT]" <wa...@citigroup.com>
To: <us...@struts.apache.org>
Sent: Tuesday, April 20, 2004 5:26 PM
Subject: Multiple ActionForms on a page - client side validation possible?


Hi,

I have a page that logically subdivides into 3 independent HTML forms and
I've subsequently planned on using 3 different ValidatorForms for each.
There seems to be no problem in configuring validations for each form's
fields and having those validations trigger from the server side.  However,
I seem to be running into problems when trying to activiate client side
validation via multiple html:javascript tags.  To simplify things, I've only
configured two ActionForms each of which has a property that uses the
"required" validator.  The tags in my JSP (in the HTML <head>) look like
this:

<html:javascript formName="form1" staticJavascript="false"
dynamicJavascript="true" />
<html:javascript formName="form2" staticJavascript="false"
dynamicJavascript="true" />
<html:javascript formName="form1" staticJavascript="true"
dynamicJavascript="false" />

The problem seems to be that each of the dynamic JS tags emits a required()
method that is not name-specific to its form.  This results in the second
such definition being the only one that is visible from the entire page.
Therefore, the form2 does correctly perform client-side validation for its
required field whereas form1 does not.

Is there a correct way to make this work?  Merging everything into one big
unwieldy form would work, but would make the data structures unmanageable.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org