About
Pricing
Community
Teams
Start Free Trial
Log in
Meinhoonaa
asked on
12/27/2012
How to replace confirm dialog box OK/Cancel with YES/NO in Javascript
How do I replace confirm dialog box OK/Cancel with YES/NO in Javascript?
<asp:TextBox ID="plateQty" runat="server" Width="50px" onblur="validate(this)" maxlength="2" CssClass="TRAStext" Text='<%#Container.DataIte
m("qty")%>
'></asp:Te
xtBox>
function validate(_this) {
if (_this.value >= "5") {
//alert(_this.value);
var retVal = confirm("Are you sure you want to order " + _this.value + " boxes?");
if (retVal == true) {
return true;
}
else {
_this.value = "";
_this.focus();
return false;
}
}
}
JavaScript
ASP.NET
6
1
Last Comment
Meinhoonaa
8/22/2022 - Mon
honestman31
12/27/2012
You cannot do that with the native confirm() as it is of browser's method.
you will need to use usejQuery UI
More info ( and source )
http://stackoverflow.com/questions/11046572/make-javascript-alert-yes-no-instead-of-ok-cancel
http://stackoverflow.com/questions/823790/javascript-confirm-popup-yes-no-button-instead-of-ok-and-cancel
honestman31
12/27/2012
also please check this
http://dev.sencha.com/deploy/ext-4.0.0/examples/message-box/msg-box.html
it will be great help for you , just copy and paste the code u want
don't forget to copy this file to your server msg-box.js
Meinhoonaa
12/30/2012
ASKER
I am looking for solution not mere links which I can find myself.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
honestman31
12/31/2012
this
http://dev.sencha.com/deploy/ext-4.0.0/examples/message-box/msg-box.html
has the solution , just choose what you want and copy and paste the code ,
P.S. to view the source code use CTR + U
ASKER CERTIFIED SOLUTION
honestman31
12/31/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Meinhoonaa
1/2/2013
ASKER
thank you
you will need to use usejQuery UI
More info ( and source )
http://stackoverflow.com/questions/11046572/make-javascript-alert-yes-no-instead-of-ok-cancel
http://stackoverflow.com/questions/823790/javascript-confirm-popup-yes-no-button-instead-of-ok-and-cancel