Scroll in a Text Box
OK, so you know how the scroll works. Now let's get that scroll to show up in a text box. Below is the altered code. I have underlined new commands to the script.
...and here's the script:
First off, if we're going to put this scroll into a text box, we're going to need a text box. So we'll start with the code at the bottom first:
You'll not I also have the commands for the button in there. You probably won't fire up your scroll from a button, but if you ever want to--here it is. The button is created simply to house an onClick() Event Handler that triggers the function to run.
OK, we know the players. Let's go back up and into the script for the display. Here's the line that gets the scroll into the text box:
document.TheForm.display.value = ScrollText.substring(0,ScrollText.length);
The only thing that has changed is the text "window.status" is now the hierarchy statement "document.TheForm.display.value". That text is directing the output of the scroll to act as the value for the text box, "display", inside the form, "TheForm", on the HTML document.
Just those few changes sent the output of the scroll to a text box. Nothing to it.
Next Time: New Script! Drop Down Link Menu & Frames