Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
07-08-2011, 05:45 PM #1
building an array from text box input
I have a text input box where users can input values separated by a line break. What I need to do is to take those values and put them all into an array once they hit "submit".
I can do this one line at a time, but I would like to be able to do it all in one hit.
thanks in advance...
07-08-2011, 06:18 PM #2
cancel that... got it with the ol' regex
var cities = document.getElementById("cities").value; var newcities=cities.replace(/\n|\r/g, '", "'); points =['"'+newcities+'"'];
07-08-2011, 08:58 PM #3
oops... spoke too soon... it only looked like an array
had more luck with this:
Last edited by xelawho; 07-08-2011 at 09:06 PM.