Check if a numeric field has a value

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

Check if a numeric field has a value

danieldotnet
Hello,

I have a numeric field and I want another field to become a mandatory field
as soon as a number is in this numeric field. Unfortunately I did not find a
solution anywhere ...

Best regards,
Daniel

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1623330717976-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Check if a numeric field has a value

Alessandro  Vernet
Administrator
Hi Daniel,

You can use the expression `$number/string() castable as xs:decimal`,
assuming your number field is named `number`, which you put in the
Validations and Alerts tab, as shown below. And the GIF linked below also
shows what this lookalike at runtime.

control-settings.png
<http://discuss.orbeon.com/file/t119778/control-settings.png>  
required-if-number.gif
<http://discuss.orbeon.com/file/t119778/required-if-number.gif>  

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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1623450591843-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Check if a numeric field has a value

Alessandro  Vernet
Administrator
Hi Daniel,

Did you get a chance to try making the field required based on formula? If so did that work for you?

-Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Check if a numeric field has a value

danieldotnet
Hi Alex

Perfect, it works fine. Thank you.

Best regards, Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Check if a numeric field has a value

Alessandro  Vernet
Administrator
Perfect Daniel, I'm glad that `$number/string() castable as xs:decimal` worked, and thank you for the confirmation.

-Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet