0

I have a validation where i want to show 'Continue' and 'Return' instead of OK and Cancel but I am not able to find accurate solution, can anyone help me on this.

<input type="button" name="submit" value="Submit" style="font:10px;">
                    <xsl:attribute name="onclick">
                      javascript:
                      var amount = document.getElementById('txtboxAdjustment14').value.trim();
                      if(amount == 0)
                      {
                      var cont =confirm("Have you considered amount?")
                      if (cont == true)
                      {
                      somemethod();
                      }
                      else if(cont == false)
                      {
                      return false;
                      }
                      }
                      else
                      {
                      somemethod();
                      }
                    </xsl:attribute>
                  </input>
Animesh
  • 41
  • 1
  • 3
  • 8
  • You can't. You'll have to create your own dialog. – bfavaretto Aug 24 '13 at 16:58
  • possible duplicate of [Javascript Confirm popup Yes, No button instead of OK and Cancel](http://stackoverflow.com/questions/823790/javascript-confirm-popup-yes-no-button-instead-of-ok-and-cancel) – bfavaretto Aug 24 '13 at 16:59

3 Answers3

1

You cannot change the buttons in JavaScript dialog.

But you can try This or This

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
0

You cannot change the buttons on the javascript confirm dialog. You would need to use a custom dialog implementation such as the one contained in SimpleModal.

Kevin Bowersox
  • 93,289
  • 19
  • 159
  • 189
0

There's no decent cross-browser solution for doing that. I'd suggest you to use some library like jQuery UI to build a custom OK-Cancel dialog.

Check out this modal confirmation dialog.

MD Sayem Ahmed
  • 28,628
  • 27
  • 111
  • 178
  • most of them have some event associated with buttons but I just want to customise text of message box(OK,Cancel -->Confirm,Return) – Animesh Aug 26 '13 at 03:34
  • @Animesh: Sorry, you can't perform that kind of customization with the default message boxes. You'll have to use something custom-made. That's the only way. – MD Sayem Ahmed Aug 26 '13 at 03:43