Hi.  Is it allowable to have multiple struts forms on the same page.  I
can't really think that there should be a problem.  Currently my page
looks something like this:

<%@ page language="java" autoFlush="true" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<html:javascript formName="RegistrationForm"
method="validateRegistrationForm" />
<html:form action="RegistrationSubmit.do" onsubmit="return
validateRegistrationForm(this)">

                       <html:text property="nickname"
styleClass="textbox01" maxlength="50" />
                       <html:text property="email"
styleClass="textbox01" maxlength="50" />
                       <html:password property="password"
styleClass="textbox01" maxlength="50" />
                       <html:password property="confirm"
styleClass="textbox01" maxlength="50" />

<html:submit />

</html:form>

<html:javascript formName="LoginForm" method="validateLoginForm" />
<html:form action="LoginSubmit.do" onsubmit="return
validateLoginForm(this)">

                       <html:text property="member_nickname"
styleClass="textbox01" maxlength="50" />
                       <html:password property="member_password"
styleClass="textbox01" maxlength="50" />

<html:submit />

</html:form>

...if I only have one form on the page at a time everything works fine,
but with both forms on the page something goes wrong with the
validation.  I got the forms to submit and validate serverside
correctly, but something goes wrong with the clientside validation.

The last form still validates correctly, but pressing on the first
submit button gives me an error:

Line: 1091
Error: 'type' is null or not an object

Debugging takes me to the following line inside function
validateMaxLength(form) :

if (field.type == 'text' ||
field.type == 'textarea') {

Ok, after having a last look at the problem I just realized that the
problem is the javascript validation functions....e.g now that there are
two forms there are two validateMaxLength (etc) functions and there's no
way to differentiate.

Is there an easy way around this problem or will I have to go and change
the source?  I can of course just cut and paste the validation and check
it before submitting with different function names but i'd rather have
the framework do it for me if possible.

Thanks for any help
S







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to