JavaScript

Ask Visitor For Name Script
 



Description:

A very simple paste-it-in script that asks the vistor for his or her name when entering your page,
then prints a "Hello" welcome message anywhere you wish in the body of the page. If the visitor
does not type in a message, a default message shows, instead. Very easy install for JavaScript
newcomers.

INSTRUCTIONS:

Paste the following <script> ... </script> block into the
<body> (notice we said the body, *not* the <head>) of
your page, exactly where you would like the message to
appear.

Design Notes:

1. When you use an in-the-body script like this, you will usually want to format the text it prints
into the page.

This is simple enough to do -- just surround the the <script> ... </script> block with font
tags, like this:

<font face="Arial" size="2" color="#FF0000">
<script>
.
.
.
</script>
</font>

Change the face, size, and color to match your design.

2. You may not, of course, want to use the "Hello Name!" message we show. See the two
commented lines in the script above for where you can change the message.

Hello!

JavaScript Functions:

Browsers Compatibility:

NS3-6, IE4-6




—
more Scripts: Alerts, Forms, Text, Buttons, Games, User Information, Calendars, Miscellaneous, Utilities,
Clocks, Navigation, Windows, Cookies, Page Information, Special Effects, Counters, Passwords, DHTML



[Home] [Templates] [Blog] [Forum] [Directory] JavaScript - Ask Visitor For Name Script