back button

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
minds_gifts
Forum Commoner
Posts: 63
Joined: Mon Feb 10, 2003 4:23 am

back button

Post 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>
DocSeuss
Forum Newbie
Posts: 10
Joined: Sat Mar 29, 2003 3:28 am

Post 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>
Post Reply