Link to home
Start Free TrialLog in
Avatar of rm3
rm3

asked on

Yes/No box in Javascript

Is there a Yes/No box in Javascript?  In the past I've used confirm, alert and prompt dialogs and want to use a Yes/No box.  If there is a way to create a Yes/No box please provide the code.  I am interested in creating a Yes/No box for future use on sites.
Avatar of bebonham
bebonham

nope, you just named them all...

some experts suggest creating an html popup to do this...

usually, if it so important that ok be yes and cancel be no, this suggestion isn't too good, because the person who is asking wants something very specific...

of course, you know you can get yes/no values back from a confirm() right??

Bob

Well I agree with bebonham. Since it is difficult to have a yes/no box, why cant you frame the question displayed on the box in such a way that the OK becomes yes and Cancel becomes NO.
For eg: something like "Please press OK for Agreeing and press Cancel for Disagreeing"

Regards.
Kobail
There is no yes/no box in javascript.
If you are coding for IE only you can use VBScript like so :

response = msgbox("Would you like to answer this question ?", vbYesNo)

The only other way would be to write a pop-up window that mimicked a yes no dialog, or write a little java applet that produced one.
ozymandias:

Are you the two huge feet that are left, or are you a giant lost to the past :)?


anyways...yes, I have seen some java applets that are exactly like confirm boxes (except not modal) The only way you can tell them apart is that you KNOW there is no yes no confirm box.

that would be a neat solution...

do you know of any code for such?

Bob
Not off the top off my head.
But now you mention it I think I might write a little all pupose dialog class just for fun.

Will post the source to this thread if any one is interested.

BTW, never really thought about which ozymandias I am.
I think that today I will be the Adrian Veidt character from The Watchmen.... maybe it'll help me concentrate.

TTFN.
:)

yeah, I'm trying to learn java...I'll post a 50 pointer for you in the java ta if you post the code for such an applet.

Bob
ASKER CERTIFIED SOLUTION
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

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

ASKER

Thanks,

This was the most useful comment I received