Formatting Passed Value Within ASP Page In Textarea?

This is a discussion on "Formatting Passed Value Within ASP Page In Textarea?" within the Classic ASP section. This forum, and the thread "Formatting Passed Value Within ASP Page In Textarea? are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 12th, 2007, 04:37
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Formatting Passed Value Within ASP Page In Textarea?

Hai..

I have an ASP page that will pass a value to another ASP page. Something like reply PM things where all the message in our PM will be put as [quote] in the reply textarea form.

I manage to get the message to be placed as the default value in my reply form:

HTML: Select all
<textarea name="myMessage" size="100" cols="60" rows="8"><%Response.Write(quoteTo)%></textarea>
What I want to do with this value is to format them like making them bold, or put them in a div like the [quote] tag..?

Anybody can help?
Thanks..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 13th, 2007, 18:02
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Isn't this kinda CSS and HTML?
You'd just find [quote] and replace is with something like "<div class="quote">" or am I missing something?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 13th, 2007, 21:14
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

You need to explain this a bit better Monie.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 14th, 2007, 01:39
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Quote:
Originally Posted by alexgeek View Post
Isn't this kinda CSS and HTML?
You'd just find [quote] and replace is with something like "<div class="quote">" or am I missing something?
This is what I wanted to do Alex!

Ok..! An illustrator might help

When I read someone message, and click the reply button, I manage to put them in my textarea reply form like this one I am replying Alex message! All Alex message will be put in my message textarea as QUOTE and later when Alex read his PM they it will be put DIV to indicate it is a QUOTE message!

So how to do this? I tried to make them bold but when diaplaying the message, it will print the <b> tag with the message! Maybe CSS could help me but I don't know how?

Thanks..
Attached Images
File Type: png reply.png (16.5 KB, 15 views)
File Type: jpg AlexPm.jpg (63.5 KB, 12 views)
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Nov 14th, 2007 at 01:43.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 14th, 2007, 07:10
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Well in PHP it would be like:
PHP: Select all

$q str_replace("[quote]""<div class=\"quote\">from <strong>AlexGeek</strong><div>Original message"$quote);
$q str_replace("[/quote]""</div></div>"$q);
echo 
$q
Something like that?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 14th, 2007, 09:21
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Hi Monie, I have expanded on Alex's PHP example in ASP:

HTML: Select all
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.:: ASP [quote] replace example ::.</title>
<style type="text/css">
<!--
#quote {
    width: 95%;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: #000000;
    border-right-color: #CCCCCC;
    border-bottom-color: #CCCCCC;
    border-left-color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size:0.8em;
    padding:3px;
}
#quote em {
    color:#FF0000;
}
h5 {
    font-family:Arial, Helvetica, sans-serif;
    font-size:0.7em;
    color:#000;
    margin-bottom:1px;
}
-->
</style>
</head>
<body>
<%
'-----Data colection and replace---------------------------------
'The values below would be collected dynamically, I have placed 
'them statically for this example.
'----------------------------------------------------------------
dim vQuote, vUser
vUser = "alexgeek"
vQuote = "[quote]This is the original message from Alex![/quote]"
vQuote = Replace(vQuote,"[quote]","<em>")
vQuote = Replace(vQuote,"[/quote]","</em>")
%>
<h5>Quote:</h5>
<div id="quote">
<%
'-----Output Quote------------------------------------------------
Response.Write("Originaly Posted by <b>"&vUser&"</b><br />")
Response.Write(vQuote)
%>
</div>
</body>
</html>
Hope this helps

Last edited by Monie; Nov 27th, 2007 at 07:58.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Nov 14th, 2007, 09:26
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Hi Monie, I have expanded on Alex's PHP example in ASP:

I have attached this in a text file as the code was not displaying properly on the forum as it was displaying quotes as visual quotes if you see what I mean

asp_replace_example.txt

Hope this helps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Nov 15th, 2007, 01:32
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Thanks Alex. Thanks Robbied. This sound promising to me! Another new programming knowledge! Let me try them first and let you guys informed soon
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Nov 16th, 2007, 06:55
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Thanks Rob, I didn't know of any replace functions in ASP.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Nov 16th, 2007, 08:44
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Quote:
Originally Posted by alexgeek View Post
Thanks Rob, I didn't know of any replace functions in ASP.
Your welcome mate, If you have a look at the following site it will show you many of the functions you can use in ASP:-

http://www.haneng.com/FunctionSearch.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Nov 17th, 2007, 07:16
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Thanks robbied for the link.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Nov 27th, 2007, 08:01
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Wow, brilliant code there! If only we have the rep points..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Nov 27th, 2007, 08:32
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

What has happened to everyones rep points?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Nov 27th, 2007, 13:52
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,795
Thanks: 0
Thanked 17 Times in 17 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

http://www.webforumz.com/webforumz-c...to-the-rep.htm - Have a look there Robbie.
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Nov 27th, 2007, 13:59
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 36
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

Quote:
Originally Posted by Marc View Post
Ah, thanks mate, it all makes sense now
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Nov 27th, 2007, 23:57
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Formatting Passed Value Within ASP Page In Textarea?

I hope there will be a good replacement for this
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On