I’ve written 50 of these things?
Half a hundred later and still going strong. Absolutely nothing can go wrong… go wrong… go wrong…
Here’s the script and its effect once again:
(It’s big. Get it all.)
We jump to the bottom again to get a handle on the buttons. You’ve probably noticed by now that this script has many of the same function types again and again. There are a bunch of buttons that display, but they all work pretty much the same way. Each has an onClick Event Handler that triggers a function found farther up the page. Last week we looked at the six functions that correspond with the six frameset buttons. What I didn’t mention was how the text got into the TEXTAREA box. First a few names. Take a look at the code toward the bottom. You see that multiple FORM elements are used. The NAME of the form itself is “Framer.” The top TEXTAREA box is named “Fillit.” The bottom box is named “Pastebox.”
When I spoke about the six frame functions last time, I neglected the code document.Framer.Fillit.value that started each one. That code points to the first TEXTAREA box setting its value. That’s why the text appears where it does.
That’s easy enough, but how does the text get pasted from the top box to the bottom box? Again, a button is involved, triggering the paste. The button’s purpose is to fire the function Copy(). It looks like this:
|
So far, so good, but there are two more buttons to deal with.
The “Start Over” button is similar to the one we just looked at. In fact, it fires the same Copy() function. The only difference is that it first launches an alert box that is intended to put you at ease. The button code looks like this:
|
The “Clear All” button fires another function named reset(). Don’t bother looking for it, it isn’t there. “Reset” is a function built into the browser. When you make guestbook forms, you create a reset button through the code:
<INPUT TYPE="reset"> |
|
Only one thing left to do: Open the new window and display it.
Next Time: Display It!