JavaScript

System Info
Clocks
Equalizer
Text in the Form
Background Color
Goodbye Pop-up
MultiLink
Window's Size
MultiLink-II

DHTML


Books

Russian | Main Page


Useful links:







Text in the Form Field | Description

If you want to use any of this examples, please put a link to our site.
Here you can find HTML-code for such link.

<html>
<head>
<title>www.redmount.com - JavaScript - Text in the Form Field</title>
<script language=javascript>
var formstart=0;
var statstart=0;
  function statusmessageobject(p,d)
  {
    this.msg = message;
    this.out = " ";
    this.pos = position;
    this.delay = delay;
    this.i     = 0;
    this.reset = clearmessage;
  }

  function clearmessage()
  {
    this.pos = position;
  }
var position = 100;
var delay    = 40;
var message  = "Welcome to REDMOUNT http://www.redmount.com";
var scroll = new statusmessageobject();
function scroller()
{
   statstart++;
   for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++)
   {
     scroll.out += " ";
   }
   if (scroll.pos >= 0)
     scroll.out += scroll.msg;
   else
     scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length);
   window.status = scroll.out;
   scroll.out = " ";
   scroll.pos--;
   if (scroll.pos < -(scroll.msg.length))
   {
      scroll.reset();
   }
   setTimeout ('scroller()',scroll.delay);
}
</script>

<script language="JavaScript">
var line="Welcome to Redmount http://www.redmount.com  ";
var speed=150;
var i=0;
function f_line()
{
  formstart++;
  if(i++<line.length)
  {
    document.cit.forum.value=line.substring(0,i);
  }
  else
  {
    document.cit.forum.value=" ";
    i=0;
  }
  setTimeout('f_line()',speed);
}
</script>

</head>
<body bgcolor="White" leftmargin=30 marginwidth=30><br>

<form name=cit>
  <input type=text size=45 name=forum>
  <br><br><br>
  <input name=sline type=button value="Text in the Status bar" onClick="if(statstart==0) scroller()">
  <input name=fline type=button value="Text in the Form Field" onClick="if(formstart==0) f_line()">
</form>

</body>
</html>