Receive the value returned in the JS in the form Builder to validate files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Receive the value returned in the JS in the form Builder to validate files

inigo10rodri
Hi,

We have a function in JS that validates the extension of the files and
depending on whether they are valid or no it returns true or false. We want
to receive the boolean result of that JS in the Form Builder to use it in
format validation. We want to do it by formula(image attached), would it be
possible? If it is not possible, it could be possible to do it in another
way?

Thank you,
Iñigo. 

<http://discuss.orbeon.com/file/t375647/validateFileExtensionFormula.jpg>

--
Sent from: http://discuss.orbeon.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].
Reply | Threaded
Open this post in threaded view
|

Re: Receive the value returned in the JS in the form Builder to validate files

Alessandro  Vernet
Administrator
Hi Iñigo,

You can do this with XPath, with something like:

   ends-with(@filename, '.pdf')

The benefit of doing validations in XPath is that this way the XForms engine
will also be able to check your data on the server, so a malicious user just
can't be able to get around your validations rules by hacking what's
happening on the browser. You'll let me know if this works for you.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Receive the value returned in the JS in the form Builder to validate files

Alessandro  Vernet
Administrator
Hi Iñigo, did you get a chance to try using XPath to validate the extension,
as suggested in my previous message? If so, did that work for you?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet