This topic is locked

Multiple Coding in Events

9/29/2014 11:14:42 AM
PHPRunner General questions
C
CWDATA author

is it possible to use more than one set of coding in for example a javaScript OnLoad event?
I want some code in that is part of a "Back to List and Save" Button that I have created and I also want to set up the hiding of a Couple of Controls based on a selection in another.
I have both sets of code in place but the Control Hiding is not working. Synatax cheack is ok and I get no errors when running the programme just not hiding the controls for me.
Current set up is as follows: -
$("#submit2").bind("click", {page: this}, function(e){

var page = e.data.page;

page.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

formObj.baseParams['submit2'] = 'Save and back to list';

}, page, {single: true});

page.on('afterSave', function(respObj, formObj, fieldControlsArr, pageObj){

delete formObj.baseParams['submit2'];

}, page, {single: true});

page.saveHn(e);

});
var ctrlCallOutcome = Runner.getControl(pageid, 'CallOutcome');

var ctrlPackageDescription = Runner.getControl(pageid, 'PackageDescription');
$("tr[data-fieldname='PackageDescription']").hide();
ctrlCallOutcome.on('change', function(e){
if (this.getValue() == 'Renew'){
$("tr[data-fieldname='PackageDescription']").show();
}else{
$("tr[data-fieldname='PackageDescription']").hide();
}
});
// Place event code here.

// Use "Add Action" button to add code snippets.
Any guidance would be gratefully received.