How to check if the field is empty or not for visibility of other field?

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

How to check if the field is empty or not for visibility of other field?

nehadhingra08
I have one field which holds attachment, if it is not empty, I want to enable and disable other field on this basis.

For example, it is not like that I am checking the dropdown value and comparing it, rather I just want to confirm the if my field as a value or not at runtime.


I could not find any Xpath expression or formula for this. 

Please help to understand the implementation of this scenario.

Thanks,
Neha

--
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/b5ef94ba-c8bf-4b41-aaea-f3f4fea8fec0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to check if the field is empty or not for visibility of other field?

Jan Horký-2
Hi, you can use attribute relevant on xf:bind
e.g.: 
This part contains value that drives visibility of another xform part
              <xf:bind ref="stx_AB_stx_PeriodSelect" name="stx_AB_stx_PeriodSelect" xxf:whitespace="trim" id="stx_AB_stx_PeriodSelect-bind">
                <xf:required id="validation-56-validation" value="true()"/>
              </xf:bind>
...
Xform part, that should be hidden
              <xf:bind relevant="$stx_AB_stx_PeriodSelect='02'" ref="stx_EB_OpenPeriod" name="stx_EB_OpenPeriod" id="stx_EB_OpenPeriod-bind">
...

For element existence you can use xpath functions empty or exists.
Kind regards, Jan.

On Fri, May 22, 2020 at 9:19 AM Neha Dhingra <[hidden email]> wrote:
I have one field which holds attachment, if it is not empty, I want to enable and disable other field on this basis.

For example, it is not like that I am checking the dropdown value and comparing it, rather I just want to confirm the if my field as a value or not at runtime.


I could not find any Xpath expression or formula for this. 

Please help to understand the implementation of this scenario.

Thanks,
Neha

--
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/b5ef94ba-c8bf-4b41-aaea-f3f4fea8fec0%40googlegroups.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/CAHex%3DvAejD17O_YBwk%2B%2BwwwaSJ%3DsyPUdySx35QikqmQopqW9Gg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to check if the field is empty or not for visibility of other field?

Alessandro  Vernet
Administrator
In reply to this post by nehadhingra08
Hi Neha,

And if you are using Form Builder, in the Control Settings for the field you
might want to disable, in the Formulas tab, for Visibility, you can enter an
expression as follows if you want the field to only be visible if no file is
uploaded to the field you named `my-file`.

    xxf:is-blank($my-file)

I hope this helps,

‑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/1590428513032-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet