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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Confirm Problem

Status
Not open for further replies.

jruiseco

Programmer
Oct 10, 2001
52
0
0
US
I have a simple javascript confirm box that says "Are you sure you want to continue? When I select no it submits anyway instead of letting the user stay there.

Help...
 
make sure your form onsubmit is expecting a return value:

onsubmit="return confirm('Are you sure?');"

=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Here is my script...

function confirmBid()
{
amount = document.submitBid.Bid_Amount.value;
confirm("You are about to submit a bid of $" + amount + ". Is this correct?");
}

Here is my onsubmit...

onclick="return confirmBid();"

How should I implement your suggestion?

Thanks...
 
function confirmBid()
{
amount = document.submitBid.Bid_Amount.value;
return confirm("You are about to submit a bid of $" + amount + ". Is this correct?");
}


=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top