Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a value in an alert box

Status
Not open for further replies.

trojan800

Programmer
Nov 27, 2001
53
US
I am trying to pass a value (lastAllowed) to the user through an alert box. Everything is working as it should be except that after the message and before the value (which is showing up correctly), the word 'undefined' is showing up everytime. Can anyone see something wrong in the following code or have any suggestions. Any and all help is appreciated. TIA - Rory

alert ("Your bio has exceeded the 100 word limit.\nPlease shorten your entry to accomodate this.\nThe 100th word is:" + lastAllowed);
 
Right before that line, insert

Code:
alert (lastAllowed);

What does it show?

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Sorry, take the space out:

Code:
alert(lastAllowed);

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
I tried the same alter message and it is working okay with no undefined.
 
...and if you insert:

Code:
alert("value: " + lastAllowed);

What exactly, is the value of lastAllowed?

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Maybe you can post a little more of the code, like what you're using to populate lastAllowed, so we can get a better idea of what's going on.

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life--};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top