OnClick Event does not inlcude scrollbar?

How can I get the onClick event of the following to include the scrollbar as well?  It works just fine if I click in the textarea, but if I only click on the scrollbar it doesn't pick it up as the click event.

<form name="form">           
          <textarea rows="8" name="wstatus" cols="60"  onclick="window.document.form.wdone.checked='true'"></textarea>
          <input type="Checkbox" name="wdone"><Font size="-1">Hold</font>
          <br>
          <span id="timerlabel"></span>
          <span id="timer"></span>
          </td>
</form>
jb6884Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

archrajanCommented:
Try this

window.onscroll = doSomething;
0
archrajanCommented:
document.onscroll = dosomething // for firefox

In MSIE the event handler is:

window.onscroll = dosomething;

window.onscroll is also working in Mozilla, but document.onscroll isn't
in MSIE.
0
jb6884Author Commented:
I can't do that because I have a document.form.wstatus.doScroll("down") running on a timer.  I'm feeding the textarea lines of text from a VBScript, and in order to keep the last line in view, I had to constantly scroll the window.  Now what I'm trying to do is enable the user to click on the textarea OR scrollbar which checks the wdone field, which in turn stops the auto scrolling.  It all works, except the dang scrollbar is not included in the onClick event of the textarea.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

archrajanCommented:
guess u cannot do that...
0
intreegCommented:
" I'm feeding the textarea lines of text from a VBScript, and in order to keep the last line in view, I had to constantly scroll the window."
You need to figure out a different way to do this and use the onScroll function as suggested by archrajan. Could you replace all of the text with the text and the new line?
0
jb6884Author Commented:
'Could you replace all of the text with the text and the new line?

that is essentially what I'm doing, but the window will stay scrolled to the top.  This needs to readout like a status window for the script, and the doscroll thingy (see my above comment) was the only way I could accomplish having the newest line visible.  I did toy with the idea of reversing the order of the lines of text, so that the newest line would be at the top and thus not needing the doscroll, however that just didn't look right.
0
jb6884Author Commented:
Does anyone know how I could scroll the textarea box from a VBScript?  If so I could scroll the box one line at a time, and get rid of my doscroll, and the need for any checkbox/onclick to stop the doscroll.

0
intreegCommented:
What if you remove the top or first line of text when you add the new or bottom line of text would this not prevent the need to scroll? I am not sure I am understanding the why you would need to scroll? Are you trying to keep all of the previous info and add more info to the bottom? If that is the case you are right other than reversing the order you would have to scroll to the bottom to see the new text. Otherwise if you are "replacing" instead of adding to it you should be able to keep the number of lines consistent and therefore would no longer need to scroll.
0
jb6884Author Commented:
Yes, I'm keeping all previous info and adding to it at the bottom.
0
intreegCommented:
If that is the case then I am not sure there is a solution. You would have to either only display X number of lines or reverse the order and display new info on top. Either of these would allow you to do away with the autoscroll and then be able to use the onScroll event.

Otherwise, I doubt it would make a difference but you could try using onMouseDown or onMouseOver possible for your "window.document.form.wdone.checked='true'" statement.
0
elleonsengaCommented:
Hi.

In your code, change "onclick" to "onfocus" like this one:

Code
====
<form name="form">
          <textarea rows="8" name="wstatus" cols="60" style="n" onFocus="window.document.form.wdone.checked='true'"></textarea>
              <input type="Checkbox" name="wdone"><Font size="-1">Hold</font>
          <br>
          <span id="timerlabel"></span>
          <span id="timer"></span></td>
</form>
=====

It should work. I have tested it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jb6884Author Commented:
that did it.  Thanks!
0
intreegCommented:
Nice Work!
0
elleonsengaCommented:
thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.