Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, can i specify a page to redirect the user to after he submits?
hello peter,
in this version you can't, because after the submit, the user is stay in the same page (it submit the form in ajax without page refresh).
what you can do, is to change the code, so after submit, the page will be redirect. you can do that in several ways, one way that i thinking about, is to use jquery to do that: http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery
Yes , perfect. Thank you.Here is what i did:
The code in bold is my changes.$(document).ready(function() { $(window).unload( function () { GUnload(); } ); $("input[type=button]").click(function() { $("#ServerMsgContainer").slideUp(); var validator = $("#ContactForm").validate({ rules: { name: { required: true }, company: { required: false }, phone: { required: true, minlength: 7, digits: true }, email: { required: true, email: true }, subject: { required: true } //message: { required: true } }, messages: { name: errName, phone: { required: errPhone, minlength: errPhone, digits: errDigits }, email: { required: errorEmail, email: errorEmail }, subject: errSubject, message: errMessage }, submitHandler: AjaxSubmit }).form(); $("#ContactForm").submit(); //$(this).closest('form').submit(); if ($("#ContactForm").valid()) { setTimeout('top.location="URL TO DISPLAY TO THE USER"', 5000) } });});
thanks for sharing. maybe someone else will find it useful.
BTY. if you like the project please vote for it on the main project page.
Eran.
Hi, a small change to my code:its better to add the redirect code to function 'AjaxSucceeded', that way the user only get redirected if everything goes well.See changes in bold.
function AjaxSucceeded(result) { $('#ServerMsgHeader').html(thankYouHeaderText); $('#ServerMsgMessage').html(thankYouMessageText); $("#ServerMsgContainer").removeClass("emailFailure"); $("#ServerMsgContainer").addClass("emailSuccess"); $('#ServerMsgContainer').slideDown('slow'); $('#ContactForm img.loader').fadeOut('fast', function() { $(this).remove() }); $("#ContactForm #submit").attr('disabled', ''); $('#ContactForm').slideUp('slow'); //Redirect user to the specified page below if ( $("#ContactForm").valid()) { setTimeout('top.location="URL TO DISPLAY TO THE USER"', SECONDS TO WAIT REDIRECTING) } return}
I will, but where on this page do i vote?'http://our.umbraco.org/projects/website-utilities/rvcontactform-multilingual-ajax-contact-form'
you are vote on the top right, where there is a number. you just click on it.
another thing, in stackoverflow they suggest to use location.replace, did you see that?
Yeah, i tried that, dosnt seem to work. Only top.location works .
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
action
Hi, can i specify a page to redirect the user to after he submits?
hello peter,
in this version you can't, because after the submit, the user is stay in the same page (it submit the form in ajax without page refresh).
what you can do, is to change the code, so after submit, the page will be redirect. you can do that in several ways, one way that i thinking about, is to use jquery to do that: http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery
Yes , perfect. Thank you.
Here is what i did:
The code in bold is my changes.
$(document).ready(function() {
$(window).unload( function () { GUnload(); } );
$("input[type=button]").click(function() {
$("#ServerMsgContainer").slideUp();
var validator = $("#ContactForm").validate({
rules: {
name: { required: true },
company: { required: false },
phone: { required: true, minlength: 7, digits: true },
email: { required: true, email: true },
subject: { required: true }
//message: { required: true }
},
messages: {
name: errName,
phone: {
required: errPhone,
minlength: errPhone,
digits: errDigits
},
email: {
required: errorEmail,
email: errorEmail
},
subject: errSubject,
message: errMessage
},
submitHandler: AjaxSubmit
}).form();
$("#ContactForm").submit(); //$(this).closest('form').submit();
if ($("#ContactForm").valid()) {
setTimeout('top.location="URL TO DISPLAY TO THE USER"', 5000)
}
});
});
thanks for sharing. maybe someone else will find it useful.
BTY. if you like the project please vote for it on the main project page.
Eran.
Hi,
a small change to my code:
its better to add the redirect code to function 'AjaxSucceeded', that way the user only get redirected if everything goes well.
See changes in bold.
function AjaxSucceeded(result) {
$('#ServerMsgHeader').html(thankYouHeaderText);
$('#ServerMsgMessage').html(thankYouMessageText);
$("#ServerMsgContainer").removeClass("emailFailure");
$("#ServerMsgContainer").addClass("emailSuccess");
$('#ServerMsgContainer').slideDown('slow');
$('#ContactForm img.loader').fadeOut('fast', function() { $(this).remove() });
$("#ContactForm #submit").attr('disabled', '');
$('#ContactForm').slideUp('slow');
//Redirect user to the specified page below
if ( $("#ContactForm").valid()) {
setTimeout('top.location="URL TO DISPLAY TO THE USER"', SECONDS TO WAIT REDIRECTING)
}
return
}
I will, but where on this page do i vote?
'http://our.umbraco.org/projects/website-utilities/rvcontactform-multilingual-ajax-contact-form'
you are vote on the top right, where there is a number. you just click on it.
another thing, in stackoverflow they suggest to use location.replace, did you see that?
Yeah, i tried that, dosnt seem to work. Only top.location works .
is working on a reply...