patmcc76 Posted October 16, 2009 Share Posted October 16, 2009 I'm trying to edit a simple form that is on a site that was built by someone else. It has a php file (leadSend.php) which contains the details for the mail recipient and then there is a js file (main.js) which contains the following: >>>>>>>>>>>>>>>>> // JavaScript Document function sendForm() { $.post('actions/leadSend.php', {name: $('#lname').val(), phone: $('#lphone').val()}, function(data) { var s =data.status; if(s===1) { $('#boxContent').text('Thank you for getting in touch. One of our agents will call you on the number you provided during business hours.'); }else if(s===-1){ $('#lname').css('color','red'); alert('Please check the name you provided and try again'); }else if(s===-2){ $('#lname').css('color','#333'); $('#lphone').css('color','red'); alert('Please check the phone number you provided and try again'); }else{ alert('We\'re sorry but the information you submitted could not be sent. Please try again or call us on xxxxxxx'); } }, 'json'); } >>>>>>>>>>>>>> At the moment when the user fills out the form, they get a text in place of the form saying "Thank you for getting in touch. One of our agents will call you on the number you provided during business hours.". Is it possible to change this so that they get redirected to a new webpage? Many thanks. Pat. Quote Link to comment Share on other sites More sharing options...
trq Posted October 16, 2009 Share Posted October 16, 2009 Why have you chosen to post what is clearly a Javascript help request within the PHP Installation & Configuration board? Quote Link to comment Share on other sites More sharing options...
haku Posted October 17, 2009 Share Posted October 17, 2009 Change this: if(s===1) { $('#boxContent').text('Thank you for getting in touch. One of our agents will call you on the number you provided during business hours.'); } to this: if(s===1) { window.location = "http://www.google.com"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.