Click to See Complete Forum and Search --> : onclick not working in IE
florida
05-07-2003, 05:05 AM
I have an input button that works great in Netscape 4 where it moves me back a page BUT in IE 5.5 it doesnt work. Please advise what Iam doing wrong with this input part?
<INPUT type="submit" value="Back" onclick="javascript:history.back()">
Charles
05-07-2003, 05:25 AM
1) You should not be using a submit button.
2) The pseudo scheme "javascript:" should never be used. Especially there.
3) As your button will do nothing at all for the one in ten users that do not use JavaScript you ought to draw the button with JavaScript.
<script type="text/javascript">
<!--
document.write('<button onclick="history.back())">Back</button>');
// -->
</script>
KeshavaR
05-07-2003, 05:36 AM
It is infact working !
I cross checked it in IE 5.5 and 6.0
;)
florida
05-07-2003, 06:39 AM
Thanks, now how would I get the it to to back AND the top of the page?
requestcode
05-07-2003, 06:50 AM
Try this:
<input type="button" value="Back onClick="history.go(-1)">
An input of type="submit" should only be used to submit forms.