Discussion:
JavaScript Confirm Box
Hevel, Shawn
2007-07-12 18:29:47 UTC
Permalink
I've got a web page that processes refunds to a credit card that the
user enters. After validating the credit card information, I proceed to
process the payment. I now need a confirmation box to display because a
user issued a refund for $135,000.00 instead of $135.00.



I need a JavaScript box to pop up and ask the user a question. If the
user answers "Yes" then continue processing the refund on the credit
card and I'll display a message saying "Refund Processed". If the user
answers "No" then don't process the refund and I'll just return to the
page.



I'm aware of the btnProcessRefund.Attributes.Add("onload", confirm("You
sure you want to process this refund?")).



I'm new at this and am having a hard time understanding how to make this
script work.



Any help would be appreciated.



Thanks,

Our vision is to develop an environment that will stimulate the
transformation of data and information into knowledge and wisdom. Our
mission is to stay focused on the plans and goals with a sense of
urgency necessary to improve the company's profitability and market
share.

Shawn Hevel, API, AIT
Lead Programmer Analyst
Information Technology Department
South Carolina Farm Bureau Insurance Companies
Phone: (803) 936-4331
Fax: (803) 936-4629
Work Email: ***@scfbins.com
Home Email: ***@sc.rr.com



===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
knutsford software.co.uk
2007-07-12 18:56:31 UTC
Permalink
You need the JavaScript confirm() command


Pam

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Adam Sills
2007-07-12 19:17:43 UTC
Permalink
You want to use
return confirm("blah blah blah") in your client-side onclick handler.

Confirm returns true or false and having
onclick="return confirm('blah')"
On a button or link will cancel the event if the user doesn't select OK.

Adam..

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Hevel, Shawn
Sent: Thursday, July 12, 2007 1:30 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] JavaScript Confirm Box

I've got a web page that processes refunds to a credit card that the
user enters. After validating the credit card information, I proceed to
process the payment. I now need a confirmation box to display because a
user issued a refund for $135,000.00 instead of $135.00.



I need a JavaScript box to pop up and ask the user a question. If the
user answers "Yes" then continue processing the refund on the credit
card and I'll display a message saying "Refund Processed". If the user
answers "No" then don't process the refund and I'll just return to the
page.



I'm aware of the btnProcessRefund.Attributes.Add("onload", confirm("You
sure you want to process this refund?")).



I'm new at this and am having a hard time understanding how to make this
script work.



Any help would be appreciated.



Thanks,

Our vision is to develop an environment that will stimulate the
transformation of data and information into knowledge and wisdom. Our
mission is to stay focused on the plans and goals with a sense of
urgency necessary to improve the company's profitability and market
share.

Shawn Hevel, API, AIT
Lead Programmer Analyst
Information Technology Department
South Carolina Farm Bureau Insurance Companies
Phone: (803) 936-4331
Fax: (803) 936-4629
Work Email: ***@scfbins.com
Home Email: ***@sc.rr.com



===================================
This list is hosted by DevelopMentor. http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Continue reading on narkive:
Loading...