How to use checkbox

496 views
Skip to first unread message

ii2team...@gmail.com

unread,
Oct 31, 2014, 11:27:29 PM10/31/14
to suppor...@runmyprocess.com
hi,

I'm using check box widget, in that i have loaded custom list(School,Transport,Taxi,Other). and i have another textbox widget. i use a JS script to listen the checkbox item, once the other is selected i want the text box visible, else not. it is work that once other is selected alone the textbox visible, but after that it unchecked means it is not geting in visible. i use the below given code.

// Conditional statement to check the Checkbox selectedValue

if(CheckOther(id_custype.getSelectedValue())){
id_pleasespecify.setVisible(true);
}
else{
id_pleasespecify.setVisible(false);// text box widget visiblity property cal
}
// Function used to check the Checkbox content
function CheckOther(value){

// Conditional statement to check the index of "Other"
if(value.indexOf('"Other"') != -1){
return true;
}
else{
return false;
}
}

Murali

unread,
Nov 2, 2014, 5:03:27 AM11/2/14
to suppor...@runmyprocess.com, ii2team...@gmail.com
Hi,
 
You need to use the predefined function RMPApplication.addListener, what we could call a manual listener, that listens to anything that changes in your form, and each time something changes, calls the function given as a parametervalueChanged_custype in this case.
 
And in this function, you'll filter on which variables you want to perform an action. In this case, you want to react if the variable custype changes. In that function add  whatever action you want to perform (could be an alert, or set a field as visible or active ... or in your case call another function that you have already defined).
 
Additional reference for similar useful Global methods available on user guide : http://docs.runmyprocess.com/API_Reference/JS

Please use below code to achive the requirement.
 
RMPApplication.addListener( valueChanged_custype );
 
function valueChanged_custype()
{

 if(CheckOther(id_custype.getSelectedValue())){
  id_pleasespecify.setVisible(true);
 }
 else{
  id_pleasespecify.setVisible(false);// text box widget visiblity property cal
 }
}
// Function used to check the Checkbox content
function CheckOther(value){
 // Conditional statement to check the index of "Other"
 if(value.indexOf('"Other"') !=  -1){
  return true;
 }
 else{
  return false;
 }
}
 
Regards,
Murali
Reply all
Reply to author
Forward
0 new messages