Click to See Complete Forum and Search --> : return link and document.write in Netscape
cmotor
09-11-2003, 11:01 AM
Netscape is not recognizing the javascript:history.go(-1) command in the script below. Does anyone know how to get it to work?
Thanks
-cmotor
function checkform() {
if (isEmpty(document.Returnform.customer_name.value)) {
document.write('<br>Error: The field below was not completed:<p>FIRST AND LAST NAME <a href="javascript:history.go(-1);">Click here to go back and fix it.</a></p>')
}
requestcode
09-11-2003, 11:18 AM
Do you mean that when you click on the link that it does not work or that the link is not being written out? The reason I ask is because I wonder if the semicolon is causing javascript to think it is finished. Try escaping the semicolon and see if that works.
function checkform() {
if (isEmpty(document.Returnform.customer_name.value)) {
document.write('<br>Error: The field below was not completed:<p>FIRST AND LAST NAME <a href="javascript:history.go(-1)\;">Click here to go back and fix it.</a></p>')
}
cmotor
09-11-2003, 11:33 AM
It writes out fine. It's jsut the return link that does not work. I tried to escape the semicolon too.
Here is a link to the page. Click on the image to open the form.
Thanks for the help
-cmotor
http://www.screamingleather.com/test_imagepop_win.html
requestcode
09-11-2003, 11:36 AM
Which version of Netscape? It works for me in NS7.0 . I don't have NS4 so I can't test it with that version.
Worked fine for me in NN7 and NN4.7 when I tried it like this:
<script type="text/javascript">
document.write('<br>Error: The field below was not completed:<p>FIRST AND LAST NAME <a href="javascript:history.go(-1);">Click here to go back and fix it.</a></p>');
</script>
cmotor
09-11-2003, 01:23 PM
I've been testing in NS6. And if it works inNS7 then that's good enough. I'll upgrade.
Thanks guys.
mucha apreciado
-cmotor