Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I dynamically populate a textarea?

Status
Not open for further replies.

qboid

Programmer
Joined
Oct 31, 2002
Messages
2
Location
GB
Hi,

I know how to populate the textarea. What I need to know is how do i insert the object at the cursor point rather than at the end of the existing text?
 
Code:
<FORM name=&quot;form1&quot;>
<INPUT type=&quot;text&quot; value=&quot;old text&quot; name=&quot;no1&quot;><BR>
<INPUT type=&quot;button&quot; onClick=&quot;document.form1.no1.value+=' my new text';&quot;>
</FORM>

this should do the trick:)
 
Thanks, but I had already established this - what I need to know is how to get the new text to populate mid where the curser point is, rather than always at the end of the old text.
 
IBM has an article that is quite intense to say the least but works only in mozilla. Search google with &quot;ahoy&quot; to find something.

window.getSelection() is the method used to find out what is selected. I found it rather buggy myself and couldn't get it to work. If you are more patient than I and find a solution do come back and share with us! :) Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top