Displaying a hidden field, once it has data. | Community
Skip to main content
New Participant
November 3, 2016
Solved

Displaying a hidden field, once it has data.

  • November 3, 2016
  • 11 replies
  • 10863 views

I have a radio button used to show/hide a comment field.  Initially the comment field’s presence is “hidden, exclude from layout” so that when the form opens, the
comment field does not show.  When the radio button is checked, the comment field then displays. Problem:  Once the user selects the radio button and enters
data into the comment field and saves it, how do you get the comment field to display every time the form is opened thus ignoring the “hidden, exclude from layout”
setting?  

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Archyron

No you should be fine there. I believe I misinterpreted your intent from your code...

This is the code you want to use:

if (this.rawValue == 1)  {

     this.resolveNode("RAConcur.Comments").presence="visible";

}

Just make sure you place the code into the change event of your radio button and that the value of your radio button actually does evaluate to 1.

11 replies

New Participant
November 3, 2016

I have the same issue, but I hadn't thought of that scenario until I read your question, so thank you!

You can add some JavaScript code to the initialize event of the comment field, which will be triggered when the form is first opened. It can then check whether the radio button is checked and make the field visible if it is, something like this:

var choice = this.resolveNode("RadioButtons.Choices").rawValue;

if (choice == 1) {

  this.presence = "visible";

}