Link to home
Start Free TrialLog in
Avatar of Meinhoonaa

asked on

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.DataItem("qty")%>'></asp:TextBox>

function validate(_this) {
            if (_this.value >= "5") {
                var retVal = confirm("Are you sure you want to order " + _this.value + " boxes?");
                if (retVal == true) {
                    return true;
                else {
                    _this.value = "";
                    return false;
Avatar of honestman31

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 )
also please check this

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
Avatar of Meinhoonaa


I am looking for solution not mere links which I can find myself.
this   has the solution , just choose what you want and copy and paste the code ,

P.S. to view the source code  use  CTR + U
Avatar of honestman31

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you