This topic is locked
[SOLVED]

 button depending on drop down box

12/12/2011 8:21:04 PM
PHPRunner General questions
S
stiven author

hello...
im trying to assign a button on the edit page depending on the selected value of a drop down box.
the code below gives me error ctrlCaseNo.getValue() is not a function i have no clue why?? is it because case_no is the key of the column?
thanks for your help



var ctrlPlace = Runner.getControl(pageid, 'place');

var place = ctrlPlace.getValue();
var ctrlName = Runner.getControl(pageid,'deceased_name');

var name = ctrlName.getValue();
var ctrlCaseNo = Runner.getControl(pageid,'case_no');

var case_no = ctrlCaseNo.getValue();
ctrlPlace.on('change', function(e){

if (this.getValue() == 'In Chapel'){

document.getElementById('rsvp').innerHTML = '<SPAN class=runner-btnframe><SPAN class=runner-btnleft></SPAN><SPAN class=runner-btnright></SPAN><A class=runner-button href="../rsvp_our_chap.php?case='+case_no+'&name='+name+'">Program</A></SPAN>';

}else if(this.getValue() == 'Outside Chapel'){

document.getElementById('rsvp').innerHTML = '<SPAN class=runner-btnframe><SPAN class=runner-btnleft></SPAN><SPAN class=runner-btnright></SPAN><A class=runner-button href="../rsvp_out.php?case='+case_no+'&name='+name+'">Program</A></SPAN>';
}

});
C
cgphp 12/13/2011

Make sure "case_no" is the real name of the field.

S
stiven author 12/13/2011

it is the real name. i just double checked 100% sure..



Make sure "case_no" is the real name of the field.

C
cgphp 12/14/2011

Is case_no field checked for edit page in the Fields tab ?

S
stiven author 12/14/2011

no it isn't because it can not be edited is the key of the column. so i have to add it to the edit page?



Is case_no field checked for edit page in the Fields tab ?

C
cgphp 12/14/2011

Add it to the edit page and set the field as readonly.