Can anyone help me create a Yes / No option popup box ?
i currently have ok/Cancel one
if (confirm
("WARNING \nAre you sure this is is correct?") )
{
document.FrmNew.Text1.value= 1
}
else
{
document.FrmNew.Text1.value=""
document.FrmNew.Text1.focus()
}
The javascript confirm box is not customizable. OK and Cancel are the only 2 options that will appear, and you cannot change this. You can create your own popup div to customize your own confirm box, but why? What you're wanting to change doesn't deviate much from what is already available. If you had an instance where you needed 7 different buttons that the user could click, or had to make sure the text was a certain color in the popup box then these are things that a confirm box does not already do - and to get this functionality you'd have to code it yourself.
However, your dilemma is that you need the exact same functionality as the confirm box with different verbage on the buttons. Personally, I find that too much work for something that is already built in. In an instance similar to yours, I would just put a small message at the bottom of the confirm box to state what functionality the buttons represent. For example:
Code:
confirm("WARNING\nAre you sure this is is correct?[!]\n\nClick OK for Yes or Cancel for No[/!]")
-kaht
Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.