![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 4
![]() |
store whitespace but not interpret it in <br>
Hello all,
my problem is the following: I have a page where the user enters some data, let's say : string1 = 'AGREHREHRHREHRE'; string2 = 'WEFEWGEWGEGEWGEGEGWG'; These data I use in another page, so I use the "<pre>" tag to display what the user has entered. The problem arrives when the user writes something like EWGEGEW EFGEGEW EGRGREGRE RGVFVDSVDS This string, when I pass it into a variable, it is stored with newlines. I don't want to make any substitution of the newlines, as I want to preserve the spaces in the next page, and display the user's sequence as entered and not with 3 <br>'s, because there were 3 spaces in the original string... any ideas? |
|
|
|
|
|
#2 |
|
Newbie
|
Not really...
Can you show us a working example of this? I could better understand what you want from that. If you want to preserve what the user entered without substituting \n characters with <br /> tags, then I suggest you print the variable in a <textarea> (it will interpret the \n character appropriately).
__________________
I wish I was you, so I could be friends with me. |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Do you have some preconceived notion that spaces and newlines are equivalent or that one is presented as the other, aside from during the rendering of the page?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|