mljonzs
Posts: 124
|
| Posted: 06/13/2006, 10:13 AM |
|
This is driving me nuts! We have two ways that we are creating data before storing into the database. First, a javascript runs and concatenates some user selections using javascript's "\r\n" between selections so when displayed in a text area it will pick up the carriage return and line feed and display each selection on a separate line. This seems to work but once it goes into the database it doesn't seem to store the carriage return and line feed so when I try to retrieve and display the data later, it jumbles everything together. A different area of the software runs ASP to build the same data field and uses the ASP constant vbCRLF. This does seem to store the carriage return and line feed the way I want it to so it displays correctly for me on a subsequent fetch. I'm getting really frustrated trying to figure out how to get the same results for the processes that use the javascript to build the data field.
Does a web page query string stip out CR & LF? That seems to be what is happening as when using the javascript, it passes the value to an ASP page via a query string and then inserts to the database (this is because I didn't really know how else to get the data put into the database)
Can anyone tell me what I should be doing differently?
_________________
What does not begin WITH God, will end in failure!
|
 |
 |
peterr
Posts: 5971
|
| Posted: 06/13/2006, 2:12 PM |
|
Such JavaScript doesn't do anything except the same as if a user would press "Enter" in a textarea field. Therefore in this respect it's irrelevant if a Javascript was used for this, or a user manually entered some text with line breaks into a textbox.
The database probably stores the carriage returns and/or line feeds, as I don't see why it wouldn't. However, Web browsers don't display such characters (there is no such thing in HTML), therefore you will not see any line breaks when you display such text on an HTML page. You can even try it it Notepad - just create an HTML file, enter some text with several line breaks and then open your HTML file in a Web browser - you will not see any line breaks.
And all that you need to do in your Web application is to convert your line break characters to the HTML line break tag <br> , either before saving data into database (in Before Insert event), or before displaying text values on a page (in Before Show event).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
mljonzs
Posts: 124
|
| Posted: 06/13/2006, 2:48 PM |
|
Thank you Peter. I think I see where I am going wrong. Passing the data through to the server the way I am doing it is a no-no as far as I can tell. I pass it in a query string parameter which is stripping out my special characters and using a regular space instead. I need to somehow put the information into a form and grab it and parse it from there before storing to the database and then maybe it will work for me.
Thank you for your input!!!
_________________
What does not begin WITH God, will end in failure!
|
 |
 |
|