PDA

View Full Version : Running a function from an overlay



KPChow
28 Mar 2011, 7:01 AM
Hi guys,

I've created a questionnaire form and need some help or advice.

In my code, I put an IF statement that can tell the user if they selected the right or wrong answer. This will open a popup box with a button. However, I can't get the button to execute the function (see below).



if (answer == "Q1a"){
Ext.Msg.alert("Well Done!", "You selected the right answer.", Ext.gotoNextQ2 <--- APPLIED FUNTION );
} else {
Ext.Msg.alert("Incorrect", "You selected the wrong answer.", Ext.gotoNextQ2);
}

var gotoNextQ2 = function(){ <--- DECLARING FUNCTION
questionPanel.setActiveItem(question2, 'slide');
}


Am I interpreting the overlay example on the Kitchensink incorrectly? :-/

Thanks
K

KPChow
29 Mar 2011, 12:39 AM
Answered my own question. Should be:



Ext.Msg.alert("Well Done!", "You selected the right answer.", gotoNextQ2() );