Page 1 of 1

back button

Posted: Fri Mar 28, 2003 7:20 pm
by minds_gifts
hello,
I'm using a form to insert records into a table.I've written the code using PHP.well, at the end of the form, i'm using the following code to take back to my main menu form.when i make some operations that is if i insert 10 records and then when i hit the back button, it takes back to the same form.
I want it as, when ever i hit the back button, it has to take me to the main screen, how should i write the java-script code for that.
could somebody please help me.

Many thanks

Code: Select all

<FORM>
<INPUT TYPE="Button" VALUE="Back" 
onClick="history.go(-1)">
</FORM>

Posted: Sat Mar 29, 2003 5:09 am
by DocSeuss
so your not actually looking for a back button which by definition take you back to the previous page. When what your really looking for is for the button to take you "Back" to a specific page. use

FORM>
<INPUT TYPE="Button" VALUE="Back"
onClick="window.location= 'specific url' ">
</FORM>