衝突的段落(下一行),我有這樣的jQuery代碼文字區域與jQuery的
setInterval(function() {
if(yo.getTime() <= d5.getTime() && yo.getTime() <= d.getTime()){//compare yo time variable with current time variable(d) and also with the end time(so that the textboxes dont exceed the endtime)
<%
ResultSet rsta2=st.executeQuery("SELECT * FROM user_start where date='"+date+"' ");%> //A table which contains data typed in the textbox(In my case I have 12 data columns hence the counter,for 6 users).
<% while(rsta2.next()){%>
var freq=$('#freq').val();//freq=30
freq=parseInt(freq);
//appending to the body of the html
var newTextBoxDiv = $(document.createElement('div')).attr("id", 'TextBoxDiv' + counter);
newTextBoxDiv.after().html('<pre><div><label style="float:left;">'+yo+'</label></div><textarea rows="15" cols="70" name="textbox' + counter + '" id="textbox" ><%=rsta2.getString("data")%></textarea></pre><input type="hidden" name="timer' + counter + '" id="timer' + counter + '" value="'+msToTime(yo.getTime())+'"/>');
newTextBoxDiv.appendTo("#TextBoxesGroup");
yo.setMinutes(yo.getMinutes() + freq);
counter++;
該代碼添加文字區域後,每半hour.This部分works.Next當我在textarea的文本添加例如
無文本段落格式(連續文本),這也適用,即它被檢索從數據庫恢復到沒有問題的textarea的,和文字區域持續半小時後出現。 現在的問題出現時,檢查該圖像
正如你可以看到我已經寫在段落這裏形成,這將進入數據庫,但一旦進入到下一行有在這兩個詞之間沒有空間該數據庫,例如這行ldhnjglfdhngfdhngjk fdbnvjcxmbnjvm
被保存在數據庫中作爲ldhnjglfdhngfdhngjkfdbnvjcxmbnjvm
(連續字符串)。但主要問題出現時,在textareas上取回它,textareas根本不出現。根本沒有。沒有一個textarea.What正在創造一個衝突?
UPDATE
我試圖把在textarea的hello1,hello2,hello3 3條單獨的線,我得到這個錯誤
我已經更新了我的問題,我告訴你什麼,從我所看到的段落(nextline)做 –
創建一個問題 –
@ user3040563你試過nl2br後發現錯誤。看到這裏:http://stackoverflow.com/a/5049048/746754 – acarlon