javascript - Clear form and redirect back to index -



javascript - Clear form and redirect back to index -

i have form takes input , enters database. fine , working perfectly, except have run issue clearing form. in wamp simply takes me contactform.php, blank page. have been trying find way of redirecting user index.php , clearing form. searching around have tried couple of things (perhaps incorrectly) including putting @ end of php:

header('location: http://stackoverflow.com');

and tried write js function it

<p><input type="submit" name="submit" value="submit" onclick="clearform();"></p>

js

function clearform(){ alert("thanks, in touch shortly"); document.getelementbyid("contactform").reset(); }

any help or pointers appreciated.

function clearform(){ alert("thanks, in touch shortly"); window.location=ur_url_here; }

when got redirect form automatically reset

javascript php html

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -