If you just wat a 'back' button, you ca just use a 'button' element instead
of a submit element:
<input type=button value=Back name="needm"  Onclick="history.back();">

If you actually do want to submit a form *and* return to previous page in
the history, you just need to use javascript to do the submit also:

<input type=button value="Submit and Go Back" name="needm"
Onclick="document.form.submit();history.back();">

The trick is you need to do the 'history.back()' after the 'form.submit()',
because the last operation is what ends up in the browser.  IE and Netscape
aren't consistent about what happens when you use an onClick with a
type='submit' -- Netscape does not even seem to do the submit if the onClick
navigates away.

It sounds like from your followup post that all you want is a back button,
so the first example is what you could use if you don't want a link or
image.

----- Original Message -----
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: "'David vd Geer Inhuur tbv IPlib'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, April 25, 2002 12:42 PM
Subject: RE: history.back() does not work in IE


> > -----Original Message-----
> > From: David vd Geer Inhuur tbv IPlib
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 25, 2002 12:32 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: RE: history.back() does not work in IE
> >
> > ..
> > Here is what I did in the script :
> >
> > $submit = "<td><input type=submit value=Back name=\"needm\"
> > Onclick=\"javascript:history.back();\"></td>";
>
> I'm no HTML expert, but aren't type="submit" and
> onclick="javascript:history.back()"
> mutually exclusive? I mean, do you want the button to submit the form, or
> go back?
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to