| Welcome to Webforumz.com. |
|
Nov 12th, 2007, 04:37
|
#1 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
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..
__________________
|
|
|
Nov 13th, 2007, 18:02
|
#2 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
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?
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Nov 13th, 2007, 21:14
|
#3 (permalink)
|
|
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
|
Re: Formatting Passed Value Within ASP Page In Textarea?
You need to explain this a bit better Monie.
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
|
|
|
Nov 14th, 2007, 01:39
|
#4 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
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; Nov 14th, 2007 at 01:43.
|
|
|
Nov 14th, 2007, 07:10
|
#5 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
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?
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Nov 14th, 2007, 09:21
|
#6 (permalink)
|
|
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
|
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
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
Last edited by Monie; Nov 27th, 2007 at 07:58.
|
|
|
Nov 14th, 2007, 09:26
|
#7 (permalink)
|
|
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
|
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 
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
|
|
|
Nov 15th, 2007, 01:32
|
#8 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
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 
__________________
|
|
|
Nov 16th, 2007, 06:55
|
#9 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Thanks Rob, I didn't know of any replace functions in ASP. 
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Nov 16th, 2007, 08:44
|
#10 (permalink)
|
|
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
|
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
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
|
|
|
Nov 17th, 2007, 07:16
|
#11 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Thanks robbied for the link.
__________________
|
|
|
Nov 27th, 2007, 08:01
|
#12 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Wow, brilliant code there! If only we have the rep points.. 
__________________
|
|
|
Nov 27th, 2007, 08:32
|
#13 (permalink)
|
|
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
|
Re: Formatting Passed Value Within ASP Page In Textarea?
What has happened to everyones rep points?
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
|
|
|
Nov 27th, 2007, 13:52
|
#14 (permalink)
|
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,750
|
Re: Formatting Passed Value Within ASP Page In Textarea?
__________________
I'm back!!!! 
|
|
|
Nov 27th, 2007, 13:59
|
#15 (permalink)
|
|
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
|
Re: Formatting Passed Value Within ASP Page In Textarea?
Quote:
Originally Posted by Marc
|
Ah, thanks mate, it all makes sense now 
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
|
|
|
Nov 27th, 2007, 23:57
|
#16 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Formatting Passed Value Within ASP Page In Textarea?
I hope there will be a good replacement for this 
__________________
|
|
|
| | |