![]()
La Tipa…
Last week you got the rundown on how this guestbook script works and since there’s no good starting point for tearing this one apart, we’ll just start from the top down. First we grab the user’s name and e-mail address and stick them in the subject line of the FORM flag.
Just in case you’re a little forgetful, here’s the script and its effect once again.
Here’s the Code for the Guestbook
The guestbook was written as two separate scripts. It didn’t have to be, but at my age, you want to make a point of keeping everything straight in your aging gray matter. So, I set the prompts apart in a script of their own. It looks like this:
var name = prompt
(“What is your name?”,”Write It Here”)
var email = prompt
(“What is your email address”, “Write It Here”)
The prompt format is pretty simple and should be familiar to you by now. A variable name is assigned by writing “var” then the variable name. In this case we used “name” for the text string the user enters for his or her name and “e-mail” to represent the text string the user puts in representing his or her e-mail address.
Use the prompt format by including the command “prompt” followed by two sets of text in parentheses. The first set of text will appear in the box itself and the second will appear in the text box on the prompt box.
Okay, so now we have these two text strings and we can place them just about anywhere by calling for them by their variable name.
The Main FORM Flag
It looks like this: