473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

new line character

Hi

I have a HTML form and on click of the submit button, I pull the values from the fields using javascript, frame them as parameters and use ajax to submit the form.

one of the fields is a textarea. If I use a new line character in the textarea, it is getting stored in the database without that ("\n\r").

from form, the value will be like "line 1 \n\r line 2"
but it is stored in the database as "line 1 line 2"

I tried to replace "\n\r" with "<br />" and store it. But the AJAX request fails if I do that.

what is the problem? any solution?
Sep 28 '11 #1
1 1736
acoder
16,027 Expert Mod 8TB
It's probably being stored, but you need to convert it back when displaying.

If you're going to send HTML, make sure to encode it and decode it back when displaying.
Oct 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Yazar Yolait | last post by:
I want to skip lines in a file that are blank and that start with "&". So I strip(None) them and then startswith("&") but the only problem is if the line has nothing but white space and I...
3
by: simon.alexandre | last post by:
Hi all, I use csv module included in python 2.3. I use the writer and encouter the following problem: in my output file (.csv) there is a duplication of the end of line character, so when I open...
4
by: Surya Kiran | last post by:
Hi all, I'm facing a wierd problem. I've a file, which is getting updated every now and then. and i'm having another program, which monitors the file. I've to read the file line by line, and in...
4
by: Someonekicked | last post by:
if you create a new file , open it and only hit enter then save. if you use seekg(0,ios::end) and then tellg(), tellg() will return 2 (not 1); so new line character is considered as two characters....
2
by: vj | last post by:
How to print a new line character . Is it chr(13) || chr(10)?
10
by: Christopher Lusardi | last post by:
How would I put an end of line character in the second line below? Textbox1.Text = "Hello " Textbox1.Text = Textbox1.Text = "World" Thanks, Chris Lusardi
1
by: KK | last post by:
Dear comp.lang.c++, The code below reads off strings of a file into a vector. ifstream srcfile("c:\\test.txt"); istream_iterator<stringstrIter(srcfile), eos; vector<string strvec(strIter, eos);...
4
by: Roshawn | last post by:
Hi, I'm creating some text based on certain parameters using a StringBuilder. I was wondering, how do I specify a newline character in VB.NET? Thanks, Roshawn
8
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I am using perl to get the data from the form fields and I have a text area from where if some one enters data like below: "This is test And this is also test This is also test." ...
3
by: Petimus | last post by:
Nowhere can I find the beginning of line Character for Regex in C#. Im using the expression *(, *)*$ But without the <Beginning of line>*(, *)*$ my strings are accepted with random letters in them...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.