By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,017 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,017 IT Pros & Developers. It's quick & easy.

Return false does not stop the submit action.

P: 2
I am currently working on the asp.net web project. I using the return false method to stop the submit action when the user choose to cancel the action.
It is working fine before I am installing the FlashGet Version 1.80.1002.

After install the FlashGet program, the page will still submitted even I put the return false in the code. Is anyone hit this problem before? Any solutions for this?

Thank you.

Sample Code:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default2.aspx" id="form1">
<div>
</div>

<div>
<input type="submit" name="Button1" value="Button" onclick="return false;" id="Button1" />
</div>

<div>
</div></form>
</body>
</html>
Jan 8 '07 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Try
Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="post" action="Default2.aspx" id="form1" onsubmit="return false;">
instead.
Jan 8 '07 #2

P: 2
Let said I want to create a popup message box with ok and cancel button. When User click on Ok Button, it will proceed to the action. If the user click cancel, the popup will disapear without refresh the page. Before that, I am using Onclick=return true/false to control. Can I know if I am using the onsubmit method, how to cater the scenario above?
Jan 9 '07 #3

10K+
P: 13,264
Let said I want to create a popup message box with ok and cancel button. When User click on Ok Button, it will proceed to the action. If the user click cancel, the popup will disapear without refresh the page. Before that, I am using Onclick=return true/false to control. Can I know if I am using the onsubmit method, how to cater the scenario above?

function confirmed(form) {
return confirm("Are you sure you want to delete");
}


.....
onSubmit = "return confirmed(this)">
Jan 9 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.