Display More Information text when a field value is changed

kb22
Kilo Contributor

I know the onLoad script for automatically displaying More Information text, but was wondering if it's possible to only open it if a field is changed after opening i.e. type of request = 'delete'?

1 ACCEPTED SOLUTION

Your client script would watch the type_of_request variable. The (untested) script would look like this:



function onChange(control, oldValue, newValue, isLoading) {


  if (isLoading || newValue == '') {


          return;


  }


if (newValue == 'delete') {


      var myVar = g_form.getControl('comments_note');


      if(myVar) {


                  var myVarHelp = $('question_help_IO_' + myVar.id.split(':')[1] + '_toggle');


                  toggleVariableHelpText(myVarHelp);


      }


  }


}


View solution in original post

11 REPLIES 11

Since it's a toggle and there's no boolean argument, I'd try calling it a second time to hide it.


I've tried the following, but not hiding.   I'm not experienced as scripting, so need a bit of additional help:



function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
          return;
    }


    //Type appropriate comment here, and begin script below
if (newValue == 'Yes') {  
      var myVar = g_form.getControl('designate_proxy');  
      if(myVar) {  
                  var myVarHelp = $('question_help_IO_' + myVar.id.split(':')[1] + '_toggle');  
                  toggleVariableHelpText(myVarHelp);
   
    if (newValue == 'No') {      
      if(myVar) {  
                 
                  toggleVariableHelpText(myVarHelp);
}
      }  
  }
}
}