Warning: This post is not about Fusebox. However, I am writing to this list
because I trust these people to help me. If you are one of the people who
hates OT posts, then please disregard.
I am trying to use some tricky Javascript to get the selected portion of
text in a text area box. For example, if you typed "My friend is cool" into
a text area box, then highlighted "My friend" and clicked a button, you
could have an alert box pop-up that will say "My friend". This is not my
end goal but I need to be able to get the highlighted portion of the text
before I can move on. If there are any Javascript gurus out there with the
answer, please let me know.
Thanks,
Jason
Here is some code that will output the entire contents of the text area box:
<script language="JavaScript">
function wrapText() {
alert(document.TestForm.TextTest.value);
}
</script>
<form name="TestForm" action="">
<input type="button" name="TestButton" value="Click here to wrap"
onClick="wrapText()">
<textarea cols="20" rows="10" name="TextTest"></textarea>
</form>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists