carriage returns and newlines entered into HTML form inputs
HTML Form contains a textarea inputs. Form submits data to MySQL database. User wants to enter distinct 'lines' into a textarea input box - such as a formatted mailing address. Street Address Suite / routing City, ST zipcode They press return at end of each line, and the textarea input box complies formatting the data on their screen. However, when I retrieve the data from the SQL database, the formatting / carriage returns are gone? Is this my imagination, or has it dropped the formatting characters? How do I pass/retain/interpret the returns? This is probably a simple NEW ZOPE USER issue, I just don't know how to phrase it when searching the list archives. Thanks in advance.
The carriage returns are probably there, it's just that you cannot see them. When you display the information try <dtml-var mailingaddress newline_to_br> which will convert the newlines in the text to '<br>' markup, the HTML equivalent of a carriage return. On Wed, 14 May 2003, AdvertisingDept wrote:
HTML Form contains a textarea inputs. Form submits data to MySQL database.
User wants to enter distinct 'lines' into a textarea input box - such as a formatted mailing address.
Street Address Suite / routing City, ST zipcode
They press return at end of each line, and the textarea input box complies formatting the data on their screen.
However, when I retrieve the data from the SQL database, the formatting / carriage returns are gone?
On Wednesday 14 May 2003 07:04 am, AdvertisingDept wrote:
HTML Form contains a textarea inputs.
User wants to enter distinct 'lines' into a textarea input box
This is where the munging happens -- the HTML textarea tag supports three different input specifications regarding the presentation of carriage returns. The default varies by browser. Get an HTML reference and check the tag for the attribute "wrap". You probably want wrap="physical" whereas you are probably either using wrap="virtual" or else it is your browser's default (best not to leave that to chance anyway). So the database probably never saw the original formatting. At least this seems most likely to me. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
participants (3)
-
AdvertisingDept -
Dennis Allison -
Terry Hancock