Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2003, 05:18 PM
Authorized User
 
Join Date: Jul 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default text-field trouble

I've this form which accepts variety of data including textfields ..i use POST.. now when i send it to my processing page i dont get the line breaks which ive entered in the textfields

in the end this data from textfield goes to access database into a field of type text - memo

how do i get back the line breaks using ASP so that when i retrieve my msg later from the db it shud look exactly like how it wuz typed in .. i dont want to mess up with javascripts ..

 
Old July 23rd, 2003, 12:43 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's what I did to solve this problem.

Before the textfield data goes to the database use a replace statement on it:

  Replace(textfield, vbCrLf, "<BR>")

Of course this assumes that you want to display the textfield data in an html page.
 
Old July 23rd, 2003, 03:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Take a look at the WRAP attribute of the <textarea> (I think that wrap is only supported by IE). You'll see that the default is not to submit line breaks. Try changing the value to 'hard' or 'off' and see if that sorts it out. (When you retrieve it later, display the text inside <PRE> tags. That will preserve your line breaks.)

hth
Phil
 
Old July 23rd, 2003, 09:38 AM
Authorized User
 
Join Date: Jul 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanx .. the 1st method did work ..

i do display the text again in text-area later on . so i use this ..

replace(objRS("Data") & "",chr(10),"<br>")

after retrieving data from the db ..






Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
long text field SKhna SQL Language 1 June 6th, 2008 12:43 PM
Trouble with formatting text in table cells! Sickopuppie HTML Code Clinic 5 June 21st, 2006 03:17 AM
Text Field Validation zaeem Pro VB Databases 1 May 27th, 2005 12:36 PM
INSERT With a Text field (C#) kwalda SQL Server 2000 1 January 10th, 2004 11:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.