View Single Post
  #5 (permalink)  
Old January 11th, 2005, 08:44 AM
vinod_yadav1919 vinod_yadav1919 is offline
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

HI Interrupt!!
Sorry I thought that you want to scroll the textbox/inputbox ,that why i posted the code.
Well you want to set the scrollbars of the textarea so that whenever your textarea is populated ,Current msgs should be shown to the user.
Here is the code,for the moment let "textfile" is the input(it may come form the text file too)
<FORM>
Enter Value <input type=text id=textfile >
<input type=button onclick="check()" value="Add"><br>
<textarea id="myid" cols=80 rows=5> </textarea>

</FORM>
<SCRIPT LANGUAGE="JavaScript">
var i
i=6
function check()
{
obj=document.getElementById("myid")
inputval=document.getElementById("textfile")
if(i==6)
{
obj.value=inputval.value
}
else
{
obj.value=obj.value+"\n"+inputval.value
}
if(i%5==0)
{
i=2*i
}
else
i=i+3
obj.scrollTop=i
}
</SCRIPT>
Hope this will help you,
I have checked it on IE.


Cheers :)

vinod