How to read textarea with certain condition
Posted
by user281180
on Stack Overflow
See other posts from Stack Overflow
or by user281180
Published on 2010-03-15T12:40:05Z
Indexed on
2010/03/15
12:49 UTC
Read the original article
Hit count: 230
jQuery
I have a textarea in which the user enters the following data:
- Paul:Nine, Rome
- Jenny:Five, India
- Bob
I want to read the data and store the values before the colon in an array and the values after the colon in another array. Please note that the user may not enter values after the colon like in case 3 above. In such case, the value must be stored in the first array as if it is before the colon.
How can I do that using jquery?
© Stack Overflow or respective owner