You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Barriscale <ba...@vodafone.ie> on 2003/06/19 15:37:18 UTC

javascript validation

Hi,

I have the following in my struts-config.xml

    <action path="/admin/createContentType"
            type="com.xdeep.pacific.servlet.admin.forms.ContentTypesAction"
            name="BillingParametersForm" scope="request"
            input="contentTypes.jsp">
      <forward name="failure" path="/admin/contentTypes.jsp?action=create"/>
      <forward name="success" path="/admin/updateBillingParameters.jsp"/>
    </action>

and in my validation.xml

<form-validation>
  <formset>
    <form name="BillingParametersForm">
      <field property="contentType" depends="required">
        <arg0 key="admin.prompt.contentType"/>
      </field>
    </form>
  </formset>
</form-validation>

and my jsp has the following form

<html:form action="/admin/createContentType" focus="contentType"
   onsubmit="validateBillingParametersForm(this);">

<html:text property="contentType"/>
<html:submit property="action" value="Create"/>
<html:reset value="Reset"/>

</html:form>

<html:javascript formName="BillingParametersForm"
   dynamicJavascript="true" staticJavascript="false"/>
<script language="Javascript1.1" src="staticJavascript.jsp"></script>


My BillingParametersForm extends org.apache.struts.validator.ValidatorForm
When the field is left blank an alert window does pop up as it should, but
after I dismiss it I get forwarded onto the success page.

Any suggestions on what I might be doing wrong.

Thanks,
Paul

I'm using Vodafone Mail - to get your free mobile email account go to http://www.vodafone.ie
Use of Vodafone Mail is subject to Terms and Conditions  http://www.vodafone.ie/terms/website




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