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
Register | FAQ | Members List | Calendar | 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 August 19th, 2004, 11:24 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem displaying text fron Db to textarea

Hello,

I am using textarea in my form. I saved the text in Oracle. Before I display value for textarea, I used Replace method. Here is my code for Replace.


strrisks = rs("risks")
if isNULL(strrisks) then
strrisks = NULL
else
strrisks = Replace(strrisks, vbCrLf, "<BR>")
strrisks = Replace(strrisks, " ", "&nbsp;")
end if

when I have to display the data, I use this code....

<INPUT type="radio" name="chkrec" value="x"
             onclick=form1.risk.value='<%=strrisks%>'">

When it displays , it displays text with <BR>

line1<BR>lin2<BR>line3<BR>

Can someone please help me. I spent lot of time on this.

Thank you
Reply With Quote
  #2 (permalink)  
Old August 19th, 2004, 11:51 AM
Registered User
 
Join Date: Aug 2004
Location: , , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think its coz you have this line using single quotes

Code:
<INPUT type="radio" name="chkrec" value="x" 
              onclick=form1.risk.value='<%=risks%>'">

---------------------------------------^==========^
Remove them and see what happens

Reply With Quote
  #3 (permalink)  
Old August 19th, 2004, 12:09 PM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It didn't work.

Reply With Quote
  #4 (permalink)  
Old August 19th, 2004, 08:07 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

hello,

  risks is a server side variable and onclick is a client side event.

It is possible
<textarea name="txt1" rows="3" cols="20"><%=risks%></textarea>


other wise, store risks in a hidden field and in the radio onclick event, call that value from hidden field.



Reply With Quote
  #5 (permalink)  
Old August 20th, 2004, 08:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi there,

I assume that form1.risk refers to the textarea. If so, textarea doesn't have a value attribute. The text has to be displayed between <textarea> and </textarea> tags. So you cannot do it that way.

<textarea>my text</textarea>

Should do that as suggested by rajanikrishna. May be you can use an IF condition to check if Radio button is checked and based on that display the strrisks variable inbetween the textarea tags.

Also you don't have to replace VBCRLF with <BR> when you want to display that in a textarea, as it doesn't understand <BR> as line-break, instead VBCRLF would do that for you inside textarea.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
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
How to store textarea in a db? Hylsan PHP How-To 1 March 1st, 2007 07:51 AM
Displaying textarea content to html table keithc Pro PHP 2 December 1st, 2006 03:12 AM
html textarea to DB ginoitalo Beginning PHP 1 May 30th, 2005 01:49 AM
ASP: Textarea Problem when updating DB seala Access ASP 1 June 13th, 2003 12:35 PM
displaying a memo in a textarea jhunta Classic ASP Basics 1 June 9th, 2003 11:04 PM



All times are GMT -4. The time now is 07:44 PM.


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