views:

138

answers:

2

I am looking for a way to use a textarea and get the values separated by commas, and place them into the array.

Really I am looking for how to auto format the textarea so when the user types something in it either forces or something a comma break. I want to use autocomplete, but I have no data to check it with since this will be a new user sign up.

What's the best approach?

+1  A: 

var text = $('#mytextarea').val().split(" ");

andres descalzo
Just about to post that but shouldn't it be split(",")?
Gavin Gilmour
and then use text=text.join(",");
andres descalzo
A: 

you can use this plugin to enforce seperation of item in textarea

This is really nice, just I do not have data to pull from, and what if a user needed to create a new value?
matthewb