Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » [SOLVED] html code inside text are


[SOLVED] html code inside text are

Closed Thread
  #1 (permalink)  
Old 06-27-05, 01:02 AM
xtreme231 xtreme231 is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] html code inside text are

hello all,
i want to put html code in textare and wanna get it parsed in webpage.i.e. i want to get the html code (inside textarea) to be parsed in web browser .is it possible.
any help is thankfully acknowledged.
thanks.
  #2 (permalink)  
Old 06-27-05, 04:01 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
this is the job of WYGSWYS, normal textareas can't do that.
check this link out:
http://www.htmlarea.com/directory/WYSIWYG_Editors/
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
  #3 (permalink)  
Old 06-27-05, 02:02 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Are you talking a fake textarea that can display HTML? If you don't plan on being able to submit any info with it, this can be done with CSS:

http://files.kbluhm.com/keith/html_textarea.html
  #4 (permalink)  
Old 06-29-05, 05:06 AM
xtreme231 xtreme231 is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
reply

now let me be clear.
i want a textarea in which html codes can be placed.the codes can be this:-
Quote:
<p><font color="#00FF00">html code</font> inside text <font color="#000080">area</font>&nbsp;
&lt;br&nbsp; /&gt;&nbsp; is it a nice <font color="#FF00FF">thinking</font></p>
<p>&nbsp;</p>
i want to copy the contents of text area or div area by clicking a button by using javascript.
what i want is 2 things.
1. i want the above code to be displayed in textarea after being parsed as html .i.e. i want the colorful output to be displayed in textarea.
2.when i should copy the contents of textarea by clicking a button ,only output should be copied.the copied code should be this :-
Quote:
html code inside text area
is it a nice thinking
can you help me or can you give me an idea.
thanks.
  #5 (permalink)  
Old 06-29-05, 05:34 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
Quote:
Originally Posted by NeverMind
this is the job of WYGSWYS, normal textareas can't do that.
check this link out:
http://www.htmlarea.com/directory/WYSIWYG_Editors/
you didn't look there, did you?
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
  #6 (permalink)  
Old 06-29-05, 02:16 PM
xtreme231 xtreme231 is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
YA,
i looked at the site and the programs listed on the site are html editors.but i donot need editors.
  #7 (permalink)  
Old 07-07-05, 02:03 PM
gcd-nice gcd-nice is offline
Newbie Coder
 
Join Date: Jul 2005
Location: Rochester
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
text area

ok I think I understand what your trying to do. It's Complicated and I dont think javascript will work.
Quote:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
.cssnamehere {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 20px;
font-weight: bold;
color: #000066;
text-decoration: none;
background-color: #CCFFFF;
}
-->
</style>
</head>

<body>
<from>
<textarea name="name" cols="2" rows="5" class="cssnamehere">Text in the field</textarea>
</form>
</body>
</html>
To get colors to be specific you will need to use a CSS for the html page.
If your looking to display that info somewhere with that look you would need a content management solution.

What is the desired result, a form will just send this somewhere as character data?
  #8 (permalink)  
Old 07-23-05, 02:55 PM
angel.of.wisdom angel.of.wisdom is offline
Newbie Coder
 
Join Date: Jul 2005
Location: lisbon, portugal
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
i'm not sure about what do you exactly want, but if it is what i think, then paste this code in notepad, save it as html and view it in your browser. i think that this works only in MSIE,because it uses SPAN tags and i don't know how to use DIVs. now it's me asking for help
Code:
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<script type="text/javascript">
function WriteToArea(){ document.all.htmlarea.innerHTML = ta.value }
</script>
<p><textarea rows=10 cols=80 id=ta></textarea>
<p><span id=htmlarea></span>
<p><input type=button onClick="WriteToArea()" value="Parse inside">
</BODY>
</HTML>



i hope this helped...

and forgive my english...


  #9 (permalink)  
Old 07-23-05, 03:02 PM
angel.of.wisdom angel.of.wisdom is offline
Newbie Coder
 
Join Date: Jul 2005
Location: lisbon, portugal
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
you can also create a NEW page with the HTML code written in that textarea. just replace

function WriteToArea(){ document.all.htmlarea.innerHTML = ta.value }

with

function WriteToArea(){ document.write(ta.value) }

OR

function WriteToArea(){ document.write("<HTML><HEAD></HEAD><BODY>" + ta.value + "</BODY></HTML>") }

i think that this might work.

any other doubts,let me know i'm here to help.
c ya later

Last edited by angel.of.wisdom; 07-23-05 at 03:03 PM. Reason: major error on script...
  #10 (permalink)  
Old 07-23-05, 03:05 PM
angel.of.wisdom angel.of.wisdom is offline
Newbie Coder
 
Join Date: Jul 2005
Location: lisbon, portugal
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
the codes i gave were to create a new webpage (virtual) that contains all HTML and JavaScript, CSS, etc that you write on the textarea. in other words, the textarea will contain the HTML code for a new page, written by the user.
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 04:03 AM
html tutoral thefrtman HTML/XHTML/XML 5 04-27-09 10:25 AM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 11:19 AM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM
Placing Flash or Graphics INSIDE text using CSS and Style Filters and DHTML 000 CSS 1 09-03-03 01:43 PM


All times are GMT -5. The time now is 08:44 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.