Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit or onUnload problem with IE? 1

Status
Not open for further replies.

trenchy

Programmer
Nov 29, 2000
5
US
The following works fine in NN but not in IE. Any ideas? IE gets to the submit() line but seems to ignore it.

function CheckSave(){
if (NotSaved){
if (confirm("Do you wish to save your notes first?")) {
NotSaved = 0;
document.notes.submit();
return false;
}
else return false;
}
}
//-->
</script>

</head>

<body onUnload=&quot;return CheckSave()&quot; bgcolor=&quot;#FFFFCC&quot;>


 
it works fine for me. all i added was NotSaved=1 above the function. jared@aauser.com
 
Which version and platform of IE are you using?
 
P.S. NotSaved get set to 1 on the onChange event of a textarea field. I've tested and it gets set properly.

 
place an alert just before and just after the submit() call, that way you can see if it ever makes it inside the if block and see if it gets past the statement. Also be sure you have set:

tools-->internet options-->advanced-->display notification about every script error

this will eliminate some of those hidden errors (or at least let you see what they are)

sorry i couldn't help more (i tested on winnt 4.0 IE5.5 jared@aauser.com
 
No apologies needed. Thanks for trying.

Yup, the &quot;display every error&quot; is set and both alerts, right before and right after the submit() get displayed. Still no submit happening.

I'm on IE 5.0 soooooo...I'm thinking it's a version bug. Will download and report back.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top