Condition :(need save each line in Textbox with php)
Required to save each line in textbox with php after submit form with textbox .Textbox can have multiple new lines and these info in each line need to be insert in database with PHP.
HTML
<textarea name=”name” rows=30 cols=40><textarea>
SCRIPT
1 2 3 4 5 6 7 |
$('textarea').keypress(function(event) { if (event.which == 13) { event.preventDefault(); var s = $(this).val(); $(this).val(s+"\n"); } }); |
PHP
1 2 3 4 5 6 |
$input = explode("\n", $_POST['name']); foreach($input as $line) { //process the $line of text as needed. } |