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(); } 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'; 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
Archived
This topic is now archived and is closed to further replies.