Help!php Posted April 4, 2012 Share Posted April 4, 2012 There is a reset button on my page and it works fine but now I want to let the user reset the information and redirect the page to homepage. So far this is how the code looks. its in javascript. function formReset() { var fields = document.getElementsByTagName( "input" ); for ( i = 0; i < fields.length; i++ ) { if ( fields[ i ].type == "checkbox" ) fields[ i ].checked = false; } document.getElementById( 'rrpmin' ).selectedIndex = 0; document.getElementById( 'rrpmax' ).selectedIndex = 0; eraseCookie( _cookieName ); fieldClick(); } Quote Link to comment https://forums.phpfreaks.com/topic/260326-after-clicking-reset-button-redirect-the-page-to-homepage/ Share on other sites More sharing options...
joe92 Posted April 4, 2012 Share Posted April 4, 2012 Add this line to the end of the JavaScript: window.location = 'http://www.mywebsite.com/homepage.php'; Quote Link to comment https://forums.phpfreaks.com/topic/260326-after-clicking-reset-button-redirect-the-page-to-homepage/#findComment-1334367 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.