I have a form where user can enter a note via a textfield.
When entering the note, user can press 'enter' to add line breaks and also the note entered can consist of multiple lines and it is stored in a table column of type varchar(2000) latin1_swedish_ci
On some other page, I am retrieving the notes from the database and storing them in an array. I am alerting the array contents to test whether everything is ok
My problem is that if the note spans on more than 1 line or contains line breaks, it does not seem to be stored in that array and the alert function does not alert anything for that particular note.
However, it is displayed properly if i display it using plain ruby code.
Here is an example of my code:
/********** loop through the resultset and store the values in the test_array **********/
<% @saved_note.each do |note| %>
<script type="text/javascript">
testarray[note_counter] = '<%= note.value %>';
alert(testarray[note_counter]);
note_counter++;
</script>
<%= note.value %>
<% end %>
Any suggestion is most appreciated.
Thanks a lot