n1875621
asked on
textareas...
i want to be able to insert a variable into a textarea exactly starting where the cursor is in the textarea...
at the moment i have
document.forms.myform.text areaname.v alue = document.forms.myform.text areaname.v alue + "anything";
this adds it to the end of the string in the textarea
but i want "anything" to appear whereever the cursor is...
any ideas?
at the moment i have
document.forms.myform.text
this adds it to the end of the string in the textarea
but i want "anything" to appear whereever the cursor is...
any ideas?
ASKER
im not after adding content to the textarea on mouse events... i am after changing the content depending on where the cursor is in the text area....
for example....
if my cursor is the pipe '|' symbol... i want to change this...
"this is the content | where and the pipe symbol is where i want to add text"
to this
"this is the content 'and this is what has to be added'| where and the pipe symbol is where i want to add text"
is that clear as mud ?
for example....
if my cursor is the pipe '|' symbol... i want to change this...
"this is the content | where and the pipe symbol is where i want to add text"
to this
"this is the content 'and this is what has to be added'| where and the pipe symbol is where i want to add text"
is that clear as mud ?
ASKER
im not after adding content to the textarea on mouse events... i am after changing the content depending on where the cursor is in the text area....
for example....
if my cursor is the pipe '|' symbol... i want to change this...
"this is the content | where and the pipe symbol is where i want to add text"
to this
"this is the content 'and this is what has to be added'| where and the pipe symbol is where i want to add text"
is that clear as mud ?
for example....
if my cursor is the pipe '|' symbol... i want to change this...
"this is the content | where and the pipe symbol is where i want to add text"
to this
"this is the content 'and this is what has to be added'| where and the pipe symbol is where i want to add text"
is that clear as mud ?
Your best hope of a solution is here:
http://msdn.microsoft.com/Downloads/samples/Internet/ie55/editregions/editregions.htm
Cd&
http://msdn.microsoft.com/Downloads/samples/Internet/ie55/editregions/editregions.htm
Cd&
ASKER
this example only shows how to append to a text area... which i can do - i want to insert into a text area where the cursor is located
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello,
This question has been open for quite a while now and needs to be wrapped up.
EXPERTS: If any of the experts could come back and post any suggestions as to how they feel this could be wrapped up (delete, 0 PAQ, award points, etc), I'm sure the moderators would appreciate it. If you feel you deserve points here, but don't care to respond, the question might very well get DELETED.
ASKER: Please return and finalize this question. Abandoning a question is in violation of the member agreement.
Please do NOT accept this comment as an answer, as I am simply trying to alert those involved that the question is still open.
Thank you,
BRUNO
I did a search and found a PAQ with similar information, so I suppose this one could be deleted. I'd be interested to hear if the problem was solved.
A delete works for me. There is already simialr in the PAQ so there is no value in PAQing it.
Cd&
Cd&
well.. i thot this question was dead.. anyways..delete it.
KC
KC
n1875621,
why would you possibly "accept a comment as answer" and then only give it a C?
That shows an incredible lack of respect for the experts. If the answer wasn't good enough to warrant at least an A or B, it should not have been accepted.
I suggest you contact Community Support (link on the left) and ask them to resolve this issue, lest the quality of help you recieve on this site decline in the future.
BRUNO
why would you possibly "accept a comment as answer" and then only give it a C?
That shows an incredible lack of respect for the experts. If the answer wasn't good enough to warrant at least an A or B, it should not have been accepted.
I suggest you contact Community Support (link on the left) and ask them to resolve this issue, lest the quality of help you recieve on this site decline in the future.
BRUNO
==========================
<script>
function stockLinkIn() {
document.forms.myform.S1.v
}
function stockLinkOut() {
document.forms.myform.S1.v
//document.forms.myform.S1
}
</script>
<form method="POST" name="myform" action="--WEBBOT-SELF--">
<textarea onMouseDown="stockLinkIn()
</form>
==========================
This will change the contents of the textarea when you click on the text area.
You can have various events onMouseDown(),onMouseUp(),
Hope this helps
Rgds
KC