PDA

View Full Version : problem with prompt and alert boxes



panvulcon
Mar 21st, 2007, 06:02 PM
hi,

for some reseon my prompt and alert boxes aint working too good. i created an example below:

question = prompt("do you want to quit")
if (question == true)
{
prompt("bye")
}
if (question == false)
{
prompt("no problem")
}

if i click ok (true) a prompt box appears saying "no problem" and when i click cancel (false) the original prompt box disapears and nothing happens.

so my question is, why is it in reverse and what am i doing wrong?

shyam
Mar 21st, 2007, 06:08 PM
prompts are used to get text input...do you mean to use confirm?


question = confirm("do you want to quit")

panvulcon
Mar 21st, 2007, 06:14 PM
thanks