How do you hold a textbox still while the webpage is scrolled?

say I have a textbox...


How can I get this to remain visible at all times when the page is being scrolled. I have posted this question several times and no one seems to provide any answer. Thus your help will be greatly appreciated.

Kind Regards

Paul G
Who is Participating?
tusharashahConnect With a Mentor Commented:
Check out this code:


<script type="text/javascript">
var gTimer2 = null;
var gTimer2Count = 0;

function Timer2()
  document.getElementById('txtBox').value = "Timer2 Running - " + gTimer2Count;
gTimer2 = window.setInterval("Timer2()",1000);


<body >

<div id="divTopRight"    style="position:absolute">
<input id='txtBox' type='TextBox' size="20" OnLoad = 'JSTimer();'/>

<script type="text/javascript">
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";
function JSFX_FloatDiv(id, sx, sy)
      var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
      window[id + "_obj"] = el;
      if(d.layers); = = sx; = = sy;
            var pX, pY;
            pX = ( >= 0) ? 0 : ns ? innerWidth :
            document.documentElement && document.documentElement.clientWidth ?
            document.documentElement.clientWidth : document.body.clientWidth;
            pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
            document.documentElement.scrollTop : document.body.scrollTop;
            pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
            document.documentElement.clientHeight : document.body.clientHeight;
   += (pX + -; += (pY + -;
            setTimeout( + "_obj.flt()", 40);
      return el;
JSFX_FloatDiv("divTopRight",         -100,   10).flt();


pgilfeatherAuthor Commented:
Sorry, I forgot to say

Im using VB.NET
If i am understanding your question correctly you want the textbox to float on the screen while you scrool the page.

The only way I can imagine doing it is using Clientside Javascript to dynamically change its position in the browser.
Hi pgilfeather,

look at this article :
it is about menu, but you can easy translate it for textbox

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.

All Courses

From novice to tech pro — start learning today.