Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yes No Pop up Box

Status
Not open for further replies.

Norman55

Programmer
Apr 27, 2006
48
GB
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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top