I need some help. I have a multi-page form which is defined similarly to the
multipage sample. The form is a self-registration form. The user's e-mail
address is used as their user-id. The first page contains a field "email".
The page needs to validate that the email address hasn't already been
registered in the system. I want to keep the validation code separate from
the form because, in the near future, the validation process will change to
using an LDAP. 

I have been able to get javascript code to execute in a validation block in
the first page's <fd:struct>, but I don't know how to provide a bean or
anything to that validation code. I've tried just passing a string from the
flow script, but it seems I can't work with it in the model section. Here's
a snippet of the flow, followed by a snipped of the model. If anyone can
help, I'd be grateful.

Please respond to [EMAIL PROTECTED], as I'm not sure where
responses are posted. Thanks much!

Gerry

Function do_registration() {
   ....
   var bizData = new Object();
   bizData["testvar"] = "hello from registration";
   ....
   Form_1.showForm("registration-display-pipeline.jx",bizData);
   ...
}


<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition";>
   <fd:widgets>
      <fd:struct id="namePage">
         <fd:validation>
            <fd:javascript>
                print("From varname: " + ${testvar});
                return true;
            </fd:javascript>
         </fd:validation>
      <fd:widgets>

      <fd:field id="email" required="true">
        <fd:label>E-mail:</fd:label>
        <fd:datatype base="string">
        <fd:validation>
          <fd:email/>
        </fd:validation>
      </fd:datatype>
   </fd:field>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to