- This topic has 1 reply, 2 voices, and was last updated 12 years, 2 months ago by
Brandon.
-
AuthorPosts
-
PeacemakerMemberI should really know this….it’s basic….I’m trying to send the user to a another screen , after they send a email using the IOS email system. Any help would be appreciated thank you.
so after they click on send or even after the 3rd party mail system has appeared on top of the app, some kind of confirmation/thank you screen. basically i’m trying to call two functions however one is mailto and another is gotoscreen at the same time
many thanks in advance guys
This isn’t working, its doing the error checking, and launching the email app with all the variables filled but not going to confirmation screen
phoneui.documentReadyHandler = function() {
}$(‘#m1-BigBrotherApp11-custom1’).live(“click”, function() {
var error = 0;
var firstname = $(‘#m1-BigBrotherApp11-textField1’).val();
var surname = $(‘#m1-BigBrotherApp11-textField2’).val();
var email = $(‘#m1-BigBrotherApp11-textField3’).val();
var phone = $(‘#m1-BigBrotherApp11-textField4’).val();
var message = $(‘#m1-BigBrotherApp11-textArea1’).val();if(firstname == ”) {
error++;
}
if(surname == ”) {
error++;
}
if(email == ”) {
error++;
}
if(message == ”) {
error++;
}if (error > 0) {
alert(‘Please fill in all the fields.\nThe phone field is optional.’);
} else {
//submit the form
//———————————————————-
phoneui.composeEmailFromPage($(‘#m1-BigBrotherApp11’), mailto:’sales@example.com‘, ‘Customer Query via App’, ‘subject=${subject}\r\n\r\nFirst Name: =${textField1} \r\nSurname: =${textField2} \r\nPhone: =${textField3} \r\nEmail: =${textField4} \r\n\r\nProduct: =${textArea1} \r\nQuestion: =${textArea2} ‘);phoneui.gotoScreen(‘m1-thankyouscreen’, ‘SLIDE_LEFT’);
//———————————————————-
} //if else
return false;
});April 2, 2013 at 6:43 am #337377
BrandonMemberWithout actually testing the code my first thought is since it is opening a different app that is stopping the page transition.
You could call the the page change just before sending the email. Or you could even call it in the page transition when it is finished going to the confirmation page.A final thought is to use php which will actually send the mail without leaving the app as well as giving a real confirmation on the sending or an error message if it doesn’t.
-
AuthorPosts