You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Felipe Nascimento <fn...@peladeiro.com.br> on 2004/01/19 20:27:23 UTC

client side validation - DynaValidatorActionForm

Hi,

I have a Form Bean of type DynaValidatorActionForm that is shared among
multiple actions.
I set validation.xml with something like the code bellow. But when I tried
to enable client side validation placing html:javascript and adding onsubmit
to html:form I can´t get it to work

What I see is that having strus-config´s action-mapping´s path in the name
attribute of validation.xml form element, it causes the javascript validate
function to be created as something with "/" character in the middle,
causing the problem.
Am I doing something wrong??

------------------------------------
validation.xml:
<formset>
  <form name="/createAddress">
    <field property="city" depends="required">
      <arg0 key="prompt.city"/>
    </field>
  </form>
.......
</formset>
------------------------------------

------------------------------------
Javascript generated by Validator:
<script type="text/javascript" language="Javascript1.1">

<!-- Begin

     var bCancel = false;

    function validate/createAddress(form) {
        if (bCancel)
      return true;
        else
       return validateRequired(form);
   }
...........
------------------------------------

------------------------------------
html:form :
 .....  onsubmit="return validate/createAddress(this)"
------------------------------------



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