Hello,

when form is loaded and data inputted in valid way -> OK
when form is loaded and phone or email field is left missing -> comes a failure page OK
when only phone is entered -> comes a failure page ERROR
when only email is enetered -> validates OK
when both are defined -> validates OK


so why does that phone thingie get's an error? I put +phone to errormessage and it showed null. So why it doesn't refresh it's values?


I have like this:

<fd:form ...>
 <fd:validation>
  <fd:javascript>
         var email = widget.lookupWidget("email");
         var phone = widget.lookupWidget("phone");
         var success = true;

if (email.value == null &amp;&amp; phone.value == null) {
email.setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("Email or phonenumber missing!", false));
success = false;
}


        return success;
  </fd:javascript>
 </fd:validation>
 <fd:widgets>
    <fd:field id="email" required="false">
      <fd:datatype base="string">
       <fd:validation>
        <fd:email/>
       </fd:validation>
      </fd:datatype>
      <fd:label>Email</fd:label>
    </fd:field>

    <fd:field id="phone" required="false">
      <fd:label>Phone</fd:label>
      <fd:datatype base="string"/>
      <fd:validation>
        <fd:length min="2"/>
      </fd:validation>
    </fd:field>
 </fd:widgets>
</fd:form>

Thanks,

Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 *


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



Reply via email to