Re: Validation by javascript on Save button

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/Validation-by-javascript-on-Save-button-tp4659746p4659751.html

Hi Pouyan,

Is the form created with Form Builder or running within Form Runner?
If it is, are you referring to the standard "save" button? Are you
saying that this is a "save draft" button, so you're OK with some data
in the form being invalid, but would like at least the email to be
there?

Alex

On Wed, Apr 1, 2015 at 7:17 PM, pouyan <[hidden email]> wrote:

> 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>
>
> --
> View this message in context: http://discuss.orbeon.com/Validation-by-javascript-on-Save-button-tp4659746.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet