How to redirect to thank you page
I have a contact form which submits infomation to my email address but at the moment the form submits the information and says thank you on the same page. I need to to redirect to a thank you page.
my code is Code:
// Contact Form
$('.validate-form').submit(function(){
var form = $(this);
form.find('.required').parents('.row:eq(0)').removeClass('field-error');
var field, v, id, msg, t, field_holder;
var alert_msg = $('.msg-alert');
var error = false;
form.find('.required').each(function(){
field = $(this);
field_holder = field.parents('.row:eq(0)');
v = $(this).val();
t = $(this).attr('title');
id = $(this).attr('id');
if( $(this).hasClass('valid-email') ){
if( /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(v) == false ) {
error = true;
}
}else {
if( v == '' || v == t ){
error = true;
}
}
if( error ) {
field.addClass('field-error');
alert_msg.fadeIn();
//error_fields.push( field );
}
});
if( !error ) {
form.find('.required').removeClass('field-error');
var data = {}
form.find('.text-field').each(function(){
data[ $(this).attr('name') ] = $(this).val();
});
form.find('.text-field').each(function(){
$(this).val( $(this).attr('title') );
});
$('#message-field').val( 'Sending...' );
$.post('send.php', data, function(){
alert_msg.fadeOut();
form.find('.msg-thanks').fadeIn(function(){
$('#message-field').val( $('#message-field').attr('title') );
window.setTimeout(function(){
form.find('.msg-thanks').fadeOut();
}, 5000);
});
});
}
return false;
});
any help with this would be great. thanks
Re: How to redirect to thank you page
That definitely isn't Java and this is a Java forum so we can't help you.
kind regards,
Jos
Re: How to redirect to thank you page
the file is a .js file, is that not a java file ?
if not have you any idea what it is /
Re: How to redirect to thank you page
Re: How to redirect to thank you page
Off topic, closing.
db
THREAD CLOSED