disable button when leaving page

A

Anonymous

Which is the correct approach to disable buttons when leaving an aspnet
page?

Currently I have the following html, which disables buttons when pressing F5
in FireFox, which ofcourse can occur before leaving the page.

<html>
<body onbeforeunload="document.getElementsByTagName( 'input' )[0].disabled =
true">
<form name="form1" method="post" action="Default.aspx" id="form1">
<input type="submit" name="Button1" value="With FireFox, this button gets
disabled when pressing F5. Not so in IE." id="Button1" />
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top