Connecting Tech Pros Worldwide Help | Site Map

prompt boxes

  #1  
Old July 20th, 2005, 10:48 AM
nuno silva
Guest
 
Posts: 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?

  #2  
Old July 20th, 2005, 10:48 AM
Lasse Reichstein Nielsen
Guest
 
Posts: n/a

re: prompt boxes


nuno silva <topolino@netvisao.pt> writes:
[color=blue]
> 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".[/color]

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 - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
  #3  
Old July 20th, 2005, 10:49 AM
nuno silva
Guest
 
Posts: n/a

re: prompt boxes


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:[color=blue]
> nuno silva <topolino@netvisao.pt> writes:
>
>[color=green]
>>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".[/color]
>
>
> 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[/color]

  #4  
Old July 20th, 2005, 10:49 AM
Lasse Reichstein Nielsen
Guest
 
Posts: n/a

re: prompt boxes


nuno silva <topolino@netvisao.pt> writes:
[color=blue]
> 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?[/color]

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 - lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cascading Combo Boxes not seeing info in previous boxes klarae99 answers 4 April 2nd, 2008 03:22 PM
Program that estimates the number of boxes of tile for a job Greatness answers 7 April 24th, 2007 04:26 PM
Message Boxes to Browser for Code Behind Troy Whitlow answers 7 November 18th, 2005 02:48 AM
Postback causes 100=Continue, causes double download prompt? Xavier Osa answers 0 November 18th, 2005 02:43 AM