Javascript – Display alternate message in textbox

Posted by Joggee | Javascript | Sunday 23 September 2007 1:45 pm

You can set timeout as your wish.

———————————————————————-

<html>

<script language=”JavaScript” type=”text/javascript”>
<!–

var text = 0;

var message=new Array();
message[0] = “Welcome to Rana’s Blog Code Project!”
message[1] = “Get free source code from Rana’s Blog.”
message[2] = “Solution will be provided on request.”
message[3] = “Good bye from Rana’s blog code project.”

function changeText() {
  if (message.length > 0) {
   document.change.descript.value=message[text];
   text++; }
  if (text == 4) {text = 0; }  // change the # 4 at the left to the maximum # of message lines you want included
   window.setTimeout(”changeText()”, 3500); }  // change the # on the left to adjust the speed of the
                                               // scroll. The smaller the # the faster the speed
//–>
</script>
<body onLoad=”changeText();”>

<!– This goes into the BODY of the html file –>

<form name=”change”>
  <textarea name=”descript” rows=”2″ cols=”33″ wrap=”virtual”></textarea>
</form>

</body>
</html>

Click here to download the source code : Displaying alternate messages

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment