Validation by javascript on Save button

Posted by pouyan on
URL: https://discuss.orbeon.com/Validation-by-javascript-on-Save-button-tp4659746.html

I would like to add a java script on save button to validate an edit box for email is not empty,
and if it is empty stay in form and not go to next step

I got following error on log and it seems
ERROR XFormsServer  -     |Unable to run a two-pass submission and xf:load within a same action sequence.


properties-local.xml:

      <property as="xs:string" name="oxf.fr.detail.process.save-draft.legal.*" >
          confirm(message = "Please confirm that you would like to submit your data.")
         then navigate(uri="javascript:myjavascript()")
         then save
         .............
      </property>


orbeon form source xml: 
   <xh:head>
        <xxf:script ev:event="xforms-ready">
                        function myjavascript() {
                           if (ORBEON.xforms.Document.getValue('plh_personal_information_email-control') = '')
                                return "Email address can't empty";
                        }
        </xxf:script>