Wrox Programmer Forums
|
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 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 November 11th, 2003, 01:18 PM
Authorized User
 
Join Date: Aug 2003
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?
 
Old November 11th, 2003, 01:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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.
 
Old November 11th, 2003, 01:54 PM
Authorized User
 
Join Date: Aug 2003
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.
 
Old November 11th, 2003, 02:02 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
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.





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





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