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>
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>
Share
Improve this question
asked Aug 24, 2013 at 16:57
AnimeshAnimesh
411 gold badge3 silver badges8 bronze badges
2
- You can't. You'll have to create your own dialog. – bfavaretto Commented Aug 24, 2013 at 16:58
- possible duplicate of Javascript Confirm popup Yes, No button instead of OK and Cancel – bfavaretto Commented Aug 24, 2013 at 16:59
3 Answers
Reset to default 1You cannot change the buttons in JavaScript dialog.
But you can try This or This
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.
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.