I have a form thats has custom submit code. I want the form to got to a success / thank you screen.
this is what i found on the threads as example to do this. It doesn’t work in the simulator.
phoneui.gotoScreen(‘order-completed’, “SLIDE_LEFT”);
My code below is my custom form function. The second code box is one of the auto generated functions, and i tried it there also, but to no avail.
Where do i put the gotoScreen code to make this work once form button is submitted?
function ssendcustomEmail()
{
var msg, subject, url, toEmailId, CompanyName;
//toEmailId =("surendar.apps@gmail.com");
var ContactName = '${contact-name}';
msg = ' Name: ${contact-name} \n ' +
' Company Name: ${company-name} \n ' +
' Company Address: ${company-address} \n '+
' Email: ${email} \n '+
' Phone # ${telephone} \n '+
' Fax # ${fax} \n \n '+
' (Quote Request Items)------------------------- \n';
// var partlist;
//partlist.html('');
for (i=0; i< ssParts.length; i++)
{
msg +='\n Type of Part - '+ ssParts[i][0] +'\n Model - '+ssParts[i][1] +'\n Size - '+ ssParts[i][2] +'\n Quantity - '+ ssParts[i][3]+'\n' ;
};
phoneui.composeEmailFromPage($('#m1-Quote_landing_screen3'), 'surendar.apps@gmail.com', 'DrillMaxOrder', msg);
phoneui.gotoScreen('m1-products_parts', 'SLIDE_LEFT');
}
};
phoneui.postSubmitForm_m1_Quote_landing_screen3 = function(isSuccess, data) {
// add custom postubmission processing code here,
// e.g., parse and process results & update UI controls with data as needed
// return false to terminate form processing
var result = true;
if (isSuccess) {
// process data
result = true;
phoneui.gotoScreen('order-completed', "SLIDE_LEFT");
} else {
// submit failed
// data = error msg
result = false;
}
return result;
}