469,270 Members | 1,108 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Yes/No dialog box in Javascript

Is there a Yes/No dialog box in Javascript? Thanks

Jul 23 '05 #1
13 67839
BillGatesFan wrote:
Is there a Yes/No dialog box in Javascript? Thanks


Well, sort of, but the text "Yes/No" depends on the browser:
confirm("Yes or no");

The confirm-box returns true if you say yes and false if no, so you can
do something like this:
if (confirm("Yes or no")) {//if yes

}
else { // if no

}
Jul 23 '05 #2
BillGatesFan wrote:
Is there a Yes/No dialog box in Javascript?
Yes.
Thanks


Welcome.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #3


There is! I thought Confirm() puts OK and Cancel on the dialog box? You
can put Yes or No? How?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #4
Bill Gates Brother wrote:

There is!
There is what?
I thought Confirm() puts OK and Cancel on the dialog box?
It does.
You can put Yes or No?
On what? You asked if there is a yes/no dialobg box, I said yes. I said
nothing about a confirm now did I?
How?


With script.

Write your own dialog box that uses a div tag that gets centered and you
can put anything you want in it.

Before asking for further explanation, please read the group FAQ. It
abounds with information that will be of great use to you.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #5
Randy you might be the biggest ass I have ever seen at a forum. Congrats

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #6
Randysajerk wrote:
Randy you might be the biggest ass I have ever seen at a forum.
Damn, and all this time I thought this was Usenet and now you tell me
its a forum. Thanks for clarifying that for me.

And while I may qualife for the biggest ass in Usenet (I'm not), you
would rank in the top 10 for the inability to read and comprehend what
you read. Had you bothered to read what I said, followed the links, and
read some more, you would have found the answer to your question.

Or, has Developersdex brainwashed you into thinking this is some kind of
question/answer forum where I just sit here waiting on lazy people to
ask stupid questions without researching it first?
Congrats
Why thank you.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Where do I collect my rewards? I want cyber-dollars so I can buy a
cyber-brain.

P.S. The FAQ I pointed you to is referenced in my signature.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #7


Dim retValue as Integer
cmdButton.Attributes("onClick") = "vbscript: retValue =
MsgBox('Demo',vbYesNo,'Save Changes?')"
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #8
Randy,
Maybe you should check the definition for the word "forum" before
stating this is not one. My eyes keep wandering off to the header of
this reply page, where I notice:

ASPdex > FORUMS & Newsgroups > Newsgroups > comp.lang.javascript

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #9
Nate N wrote:
Randy,
Maybe you should check the definition for the word "forum"
before stating this is not one. My eyes keep wandering off
to the header of this reply page, where I notice:

ASPdex > FORUMS & Newsgroups > Newsgroups > comp.lang.javascript


If a category is listed as ">FORUMS & Newsgroups" and followed by the
qualification ">Newsgroups" wouldn't it make more sense to assume that
the subject of that qualification was *not* a forum?

But if you want to participate in Usenet newsgroups I would recommend
that you get away form Developersdex. They used to be reasonably
competent a couple of years ago but they have completely lost the plot
recently. Your best bet is to arrange access to a new server (if you ISP
doesn't already provide one) and get some proper newsreader software (or
outlook express).

Richard.
Jul 23 '05 #10
Richard Cornford wrote:
<snip>
... access to a new server (...

^
<snip>

In case it isn't obvious, that should have been "news server".

Richard.
Jul 23 '05 #11
JRS: In article <41**********@127.0.0.1>, dated Sun, 16 Jan 2005
10:20:28, seen in news:comp.lang.javascript, Nate N <no*****@gmail.com>
posted :
Randy,
Maybe you should check the definition for the word "forum" before
stating this is not one. My eyes keep wandering off to the header of
this reply page, where I notice:

ASPdex > FORUMS & Newsgroups > Newsgroups > comp.lang.javascript

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

You are very naive; and also a careless reader. Developersdex calling
this a forum would not be sufficient to make it a forum. And, from the
structure you quote above, they do not call this a forum; it is in the
non-forums part of "forums and newsgroups".

It is an Internet Newsgroup; a public resource.

Dd is neither the best nor the worst of a number of organisations which,
to suit your own ends, have created parasitic front-ends of greater or
lesser competence, to give such as you the illusion that you are using a
service that they have built.
How are those who provide answers here to be properly rewarded? - the
ignorant questioners should be giving, rather than receiving, payment.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #12
Nate N wrote:
Randy,
Maybe you should check the definition for the word "forum" before
stating this is not one.
I know precisely what a "forum" is. And this is NOT a forum. This is
Usenet News, comp.lang.javascript specifically.

My eyes keep wandering off to the header of
this reply page, where I notice:

ASPdex > FORUMS & Newsgroups > Newsgroups > comp.lang.javascript

This image:
<URL: http://members.aol.com/hikksnotathome/reply.jpg >
is a screenshot of this reply window I am typing in. Go look at it, then
come back and tell me where it says all that hog-wash garbage you say
above.

You need to learn the difference between developersdex and usenet.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Where are my rewards? I should get double, nah triple, rewards for
educating DD's users.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #13
> Dim retValue as Integer
cmdButton.Attributes("onClick") = "vbscript: retValue =
MsgBox('Demo',vbYesNo,'Save Changes?')"


I asume you realize this, but the code you submited is visual basic
script, not javascript. VBScript should be avoided except for web
applications that are only intended to be run in Internet Explorer.

Jul 23 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.