Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 11th, 2003, 01:18 PM
Authorized User
Points: 447, Level: 7
Points: 447, Level: 7 Points: 447, Level: 7 Points: 447, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Adrian, MI, USA.
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default text area showing LineFeed CariageReturns

I have a <textarea> thats linked to an Access field of type 'memo'. The text area has a bunch of carriage returns and line feeds in it prior to the user typing anything in. Can anyone explain this?
Reply With Quote
  #2 (permalink)  
Old November 11th, 2003, 01:29 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is there anything between the <textarea...> and </textarea> tags? thats the only reason I could see. I'm willing to bet that you have some white space in your ASP code that's around the VBScript where you get the database values. This would result in whitespace between the tags that ends up in what should be an empty box.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
  #3 (permalink)  
Old November 11th, 2003, 01:54 PM
Authorized User
Points: 447, Level: 7
Points: 447, Level: 7 Points: 447, Level: 7 Points: 447, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Adrian, MI, USA.
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks planoie,
I get lazy while editing HTML knowing that it ignores tabs, spaces, linefeeds ect. However in this case I'm setting a value and I overlooked that fact. You nailed it, my code was:

<textarea name="txtNotes" cols="35" id="txtNotes">

<%
If NOT blnNew Then
     Response.Write(objRS("txtNotes"))
End If
%>

</textarea>

I changed to:


<textarea name="txtNotes" cols="35" id="txtNotes"><%
If NOT blnNew Then
     Response.Write(objRS("txtNotes"))
End If%></textarea>


and now life is good. Thanks much.
Reply With Quote
  #4 (permalink)  
Old November 11th, 2003, 02:02 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The other thing you can do for the sake of readability is this...

If NOT blnNew Then
     sTxtNotes = objRS("txtNotes")
End If

<textarea name="txtNotes" cols="35" id="txtNotes"><%=sTxtNotes%></textarea>

It's also better to keep your business/database login outside of the display code. Just makes it a bit easier to read.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text area Wenggo VBScript 5 September 20th, 2008 07:21 PM
Submit text to main page from text area... user0b PHP How-To 2 June 30th, 2008 09:52 PM
Need help: Not able to Assign Value to a Text Area steveleong Classic ASP Professional 3 February 20th, 2008 09:15 PM
text area box shoakat Classic ASP Databases 2 September 11th, 2004 07:28 AM
text in limited area alittlebitter32 Dreamweaver (all versions) 4 July 8th, 2004 10:28 AM



All times are GMT -4. The time now is 11:59 PM.


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