By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,612 Members | 1,632 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,612 IT Pros & Developers. It's quick & easy.

prompt boxes

P: n/a
i'm new to javascript, and so I'd like to know if there's a way to make
a prompt box, that, instead of having "ok" "cancel" and a text box,
would just have buttons of "yes" "no".

Is there a method that can do it?

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
nuno silva <to******@netvisao.pt> writes:
i'm new to javascript, and so I'd like to know if there's a way to
make a prompt box, that, instead of having "ok" "cancel" and a text
box, would just have buttons of "yes" "no".


You are probably looking for the "confirm" function instead of "prompt".
You can not decide what text is on the buttons.
<URL:http://jibbering.com/faq/#FAQ4_28>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
ok... I've done it. that's what I wanted. Now tell me something:

when I press ok button what result should go to a local variable?
i'm asking?
if (option == okbutton) do this ----> what should be the value instead
of okbutton?
else do that...
Lasse Reichstein Nielsen wrote:
nuno silva <to******@netvisao.pt> writes:

i'm new to javascript, and so I'd like to know if there's a way to
make a prompt box, that, instead of having "ok" "cancel" and a text
box, would just have buttons of "yes" "no".

You are probably looking for the "confirm" function instead of "prompt".
You can not decide what text is on the buttons.
<URL:http://jibbering.com/faq/#FAQ4_28>

/L


Jul 20 '05 #3

P: n/a
nuno silva <to******@netvisao.pt> writes:
ok... I've done it. that's what I wanted. Now tell me something:

when I press ok button what result should go to a local variable?
i'm asking?
if (option == okbutton) do this ----> what should be the value
instead of okbutton?


I am not sure I understand the question.

The way I use the confirm function is

if (confirm("Should we go on?")) {
//do something on OK
} else {
//do something else on Cancel
}

The confirm function returns a boolean, either true or false,
depending on which button you pressed.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.