[Javascript] Textareas
Terry Riegel
riegel at clearimageonline.com
Mon Aug 7 14:11:09 CDT 2006
Ok, I have this working pretty close so far. Here is what I am doing
so far.
<body onload="theform.mytext.setSelectionRange
(theform.saveloc.value,theform.saveloc.value);">
<form method="post" action="thispage.html" name="theform">
<input type="hidden" name="saveloc" value="7148">
<textarea name="mytext" cols="60" rows="15"></textarea>
<input type="submit" name="mybutton" value="Save"
onclick="theform.saveloc.value=theform.mytext.selectionStart;">
</form>
Everything is working as expected. When I save it stores the cursor
location in "saveloc", and when the page loads it places the cursor
at "saveloc", All I need now is to figure out a way to scroll to the
current cursor location.
Any Ideas.
Terry Riegel
On Aug 7, 2006, at 2:45 PM, Steve Clay wrote:
> Monday, August 7, 2006, 1:32:11 PM, Terry Riegel wrote:
>> Is there a way to remember the scroll value of a textarea, and upon
>
> From some quick testing, IE/win, FF and Opera (at least) expose
> this as
> Element.scrollTop for textareas AND div elements with overflow:scroll
> (dunno about other elements).
>
> Opera's scrollTop is broken for textareas though.
>
> I haven't tried setting any of these. Give it a shot.
>
> --
> Steve
> http://mrclay.org/
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
More information about the Javascript
mailing list