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
  • It seems like the showWhen parameter on whatever text input field you are using is the best solution, like annap suggested, assuming you want to hide the whole field. However if you really want to hide the text input and not the entire field then you should set the value to some conditional statement.

    Here is annap's code modified to do this instead.

    contents: {
    a!radioButtonField(
    label: "Test",
    choiceLabels: {
    "Yes",
    "No"
    },
    choiceValues: {
    true(),
    false()
    },
    value: ri!flag,
    saveInto: ri!flag
    ),
    a!textField(
    label: "Lorem Ipsum",
    labelPosition: "ABOVE",
    value: if (
    ri!flag,
    "",
    ri!textValue),
    ),
    saveInto: if (

    ri!flag,

    {},

    ri!textValue)
    }

    This is a bit odd though. I'm not sure that you would want to do this. As Mike said, more detail would help.

Reply
  • It seems like the showWhen parameter on whatever text input field you are using is the best solution, like annap suggested, assuming you want to hide the whole field. However if you really want to hide the text input and not the entire field then you should set the value to some conditional statement.

    Here is annap's code modified to do this instead.

    contents: {
    a!radioButtonField(
    label: "Test",
    choiceLabels: {
    "Yes",
    "No"
    },
    choiceValues: {
    true(),
    false()
    },
    value: ri!flag,
    saveInto: ri!flag
    ),
    a!textField(
    label: "Lorem Ipsum",
    labelPosition: "ABOVE",
    value: if (
    ri!flag,
    "",
    ri!textValue),
    ),
    saveInto: if (

    ri!flag,

    {},

    ri!textValue)
    }

    This is a bit odd though. I'm not sure that you would want to do this. As Mike said, more detail would help.

Children
No Data