Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript redirect to thankyou page with self posting php email form. Pretty please :) Re: redirect to thankyou page with self posting php email form. Pretty please :)

#82414
rubistarr
Member

I am new to the world of php java and Ajaxing so if you could give me a hint as to how to use the java script to redirect that would be great. To be honest, I am just starting to figure out php and am not really sure if I am using ajax or not. There are three files in a scripts folder that work the contact form. One is a js form with the below code and the other two are php files and then there is the main contact php page that actually shows the form.

$(function(){
$('#form_submit').click(function(){

var input_name = $('#form_name').val(),
input_email = $('#form_email').val(),
input_subject = $('#form_subject').val(),
input_message = $('#form_message').val(),
response_text = $('#response');

response_text.hide();
response_text.html('Loading...').show();

$.post('http://theme/scripts/contact-process.php', {name: input_name, email: input_email, subject: input_subject, message: input_message}, function(data){
response_text.html(data);
});
return false;
});

});