冲突的段落(下一行),我有这样的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