473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Javascript control of textarea?

Can Javascript control sections of a textarea using divs, etc? We have
templates that unfortunately contain some free-text sections where our
clients cannot come to aggreement. I would LOVE to do a div inside the
textarea and modify it using ajax. I would also like to have a regular
expression look for patterns inside the text area and highlight phone
numbers. this kind of behavior doesn't seem possible. Unfortunately
I'm in a break from a requirements gathering meeting and can't work up
a demo today. Do any of you know if this can work in the IE DOM?

thanks!

Don

Feb 15 '06 #1
1 1368


bb*****@gmail.com wrote:
Can Javascript control sections of a textarea using divs, etc? I would LOVE to do a div inside the
textarea and modify it using ajax.


A HTML textarea contains plain text, not any other HTML elements like
div elements.

If you want editable HTML contents then with IE 5.5 and later on Windows
you can use editable elements with e.g.
<div contenteditable="true">
scripted as
element.contentEditable

IE 5 and later on Windows and Mozilla 1.4 and later on all platforms
also supports editable iframes where you use script to set
iframeDocument.designMode = 'on'
to allow the browser user to edit the iframe contents.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: dan glenn | last post by:
hi. I'm having a problem using javasript to pass the value of a textarea (in a form) to a PHP script file. I want to code a 'preview' function into a guestbook entry page, using an HTML link...
3
by: M Wells | last post by:
Hi All, I'm wondering if anyone can point me to some JavaScript code I can drop into a page to respond to an attempt to click on specific links if content in textarea on a form has been changed...
1
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
3
by: Dave | last post by:
I have a button that calls a JavaScript. I need to get the value in an asp:TextBox field to the javascript, either as a parameter or via some mechanism within the JavaScript itself. Any Ideas? ...
13
by: John Smith | last post by:
I am using IE 6.0 from http://www.javaworld.com/javaworld/jw-07-1996/jw-07-javascript-p2.html I gather that "If you need to test a number of command lines, you can reduce the keystrokes by...
1
by: den2005 | last post by:
Hi everybody, I am confused and still looking why this codes is not working. Can anyone notice or know why this code is not working? Thanks in advance. Code working: <form id="form1"...
7
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.