PDA

View Full Version : Equal to / not equal to?


Thylacine
04-01-2003, 10:16 PM
I want a warning to pop up when people have not entered anything for their name, but try to press continue.

My problem is that even when someone has entered their name, the box pops up and says they have not.
Why does it do this?


(action on the frame)


namo = "";


if (namo == "") {
conbutt.onPress = function() {
//tell the person they need to enter their name
};
}

if (namo != "") {
conbutt.onPress = function() {
//go to the next page
};
}


I have a feeling the answer to this is really obvious and I'll look kind of dumb..:)

vosgien
04-02-2003, 05:37 AM
Hi Thylacine,
You have just put your code in the wrong order, try this :

conbutt.onPress = function() {
if(!namo.length){
//tell the person to enter name
} else {
//goto nextpage
};

That should the trick,
hope it helps

Cheers

Vosgien

Thylacine
04-02-2003, 02:40 PM
Thank you!:)