How to hide text input using radio button?

Hi everyone,

                 Can anyone help me out with this scenario:When clicking on the radio button i need to hide the below text input?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi do you want to hide the text input or the complete text field?

    1. If you want to hide only text input in that case, you can have an another approach as well, apart from as suggested above:

    Let's say, you have a local variable local!choice_bool which captures radio button input as true or false, now declare a variable, let's say, local!placeholder
    Now you can configure your text field value as

    value:
    if (local!choice_bool=true(), local!placeholder, ri!myTextInput)
    saveInto : ri!myTextInput
    Here ri!myTextInput is the actual variable where you Text field value will be stored (if Any)

    2. If you want to hide complete Text field then configure following

    showWhen: not(local!choice_bool)

    Which indicates, when choice_bool is not true or false then display this field

    Make sure to define local!choice_bool either on load or as rule input, the default value for it should be false

    Hope this will help you.
Reply
  • 0
    Certified Lead Developer
    Hi do you want to hide the text input or the complete text field?

    1. If you want to hide only text input in that case, you can have an another approach as well, apart from as suggested above:

    Let's say, you have a local variable local!choice_bool which captures radio button input as true or false, now declare a variable, let's say, local!placeholder
    Now you can configure your text field value as

    value:
    if (local!choice_bool=true(), local!placeholder, ri!myTextInput)
    saveInto : ri!myTextInput
    Here ri!myTextInput is the actual variable where you Text field value will be stored (if Any)

    2. If you want to hide complete Text field then configure following

    showWhen: not(local!choice_bool)

    Which indicates, when choice_bool is not true or false then display this field

    Make sure to define local!choice_bool either on load or as rule input, the default value for it should be false

    Hope this will help you.
Children
No Data