|
|
 |
November 12th, 2007, 12:37 AM
|
#1
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,628
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:
<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..
|
|
|
November 13th, 2007, 02:02 PM
|
#2
|
|
Elite Veteran
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 17
Posts: 3,799
Thanks: 2
Thanked 3 Times in 3 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?
|
|
|
November 13th, 2007, 05:14 PM
|
#3
|
|
WebForumz Member
Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Formatting Passed Value Within ASP Page In Textarea?
You need to explain this a bit better Monie.
|
|
|
November 13th, 2007, 09:39 PM
|
#4
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,628
Thanks: 0
Thanked 4 Times in 3 Posts
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Quote:
Originally Posted by alexgeek
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..
Last edited by Monie; November 13th, 2007 at 09:43 PM..
|
|
|
November 14th, 2007, 03:10 AM
|
#5
|
|
Elite Veteran
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 17
Posts: 3,799
Thanks: 2
Thanked 3 Times in 3 Posts
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Well in PHP it would be like:
Code:
$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?
|
|
|
November 14th, 2007, 05:21 AM
|
#6
|
|
WebForumz Member
Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Hi Monie, I have expanded on Alex's PHP example in ASP:
<%@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; November 27th, 2007 at 03:58 AM..
|
|
|
November 14th, 2007, 05:26 AM
|
#7
|
|
WebForumz Member
Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
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 
|
|
|
November 14th, 2007, 09:32 PM
|
#8
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,628
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 
|
|
|
November 16th, 2007, 02:55 AM
|
#9
|
|
Elite Veteran
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 17
Posts: 3,799
Thanks: 2
Thanked 3 Times in 3 Posts
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Thanks Rob, I didn't know of any replace functions in ASP. 
|
|
|
November 16th, 2007, 04:44 AM
|
#10
|
|
WebForumz Member
Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Quote:
Originally Posted by alexgeek
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
|
|
|
November 17th, 2007, 03:16 AM
|
#11
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,628
Thanks: 0
Thanked 4 Times in 3 Posts
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Thanks robbied for the link.
|
|
|
November 27th, 2007, 04:01 AM
|
#12
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,628
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.. 
|
|
|
November 27th, 2007, 04:32 AM
|
#13
|
|
WebForumz Member
Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Formatting Passed Value Within ASP Page In Textarea?
What has happened to everyones rep points?
|
|
|
November 27th, 2007, 09:52 AM
|
#14
|
SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 2,086
Thanks: 2
Thanked 23 Times in 23 Posts
|
Re: Formatting Passed Value Within ASP Page In Textarea?
|
|
|
November 27th, 2007, 09:59 AM
|
#15
|
|
WebForumz Member
Join Date: Sep 2007
Location: Wales, UK
Age: 37
Posts: 91
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Quote:
Originally Posted by Marc
|
Ah, thanks mate, it all makes sense now 
|
|
|
November 27th, 2007, 07:57 PM
|
#16
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 28
Posts: 1,628
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 
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|