I am working with arrays at the moment. I have made an app where you type in a name and click the add button, it adds it to the array and is displayed in the textbox. At the moment it comes up: name1,name2,name1.... etc
I want it to appear:
My current code for the button is:
the newName variable is what you have typed in the textbox. I want to make it go to the next line first then add the name to the list. Any ideas?
users[newUser] = newName;
newUser = users.length;
users = users;
newName = "";
-= Double Post =-
come on guys
I don't get what you want? If you want to add the variable at the end of the array, use push();
"the newName variable is what you have typed in the textbox. I want to make it go to the next line first then add the name to the list. Any ideas?"
That part is confusing.
What I think is that it adds to the end of the array, then displays on the visual list.
i was going to say you could narrow up the text box so instead of it displaying the names in a straight line, the narrow-ness would force the text down underneath it. But when i tried it it literally displayed:
Bob Jim Bob J
instead of :
it just cut off the text so u couldnt read it.
it may not help you but it'll eliminate a possibility
u could split each object in the array and then use /n for a new line