Today is . Page created 04/15/07

Stop! Form Screener Access Denied

The form has been set to reject the following e-mail addresses and User Names:

E-mail Address

test1@email.com
test2@email.com
test3@email.com
test4@email.com
test5@email.com

User Names

chickenhead
beanbag
thunderchicken
bozotheclown
napoleondynamite

This form is not valid and will not submit. It is just for example purposes.

If you click "Submit" with the form empty or type into the above box any user name or e-mail address other than what we have it configured to reject and then click "Submit", you will get an error message in your task bar(if you are using IE). Reason being is that the effect is not associated with a functioning form, no other reason.

Don't want a certain person to fill out a form? Using this script, those people will be rejected after they put their name in.

We have tested the code in IE7.0, Firefox2.0.0.1, Opera9.10, Netscape8.1.2 and AOL Explorer1.5. This script worked well in all platforms with no variations observed.

For Your Information For your Information:     Before we begin, we feel obligated to advise you that the above form is for all intensive purposes a "Stand Alone" script. In other words, it really does not do much of anything other than what you see. In order to make it function as designed, you need to incorporate it into a valid working form. If you do not have a good Solid Knowledge of HTML coding, javascripts, forms and reconfigurations, please "Do Not Attempt" this until you are Proficient in the aforementioned areas.

Depending on your knowledge of HTML and javascripts, this is an easy two (2) part copy and paste code that goes in both the <HEAD> section and <BODY> section (incorporated into a working form) of your document. The reconfigurations to be made are located within the <HEAD> section. See below where and howto.

The reconfigurations to be made are located within the <HEAD> section of the script. This is where you will edit the list of names,email addresses etc. that you weant blocked to fill out the form. This is also where you can reconfigure the message given when access is denied. See below where and howto.

<------ Default ------>

<script language="javascript">
<!--
//These are the names of the people you don't want

//To add a person, just put their name in quotation marks
//and add a comma after
Names = new Array(
"test1@email.com",
"test2@email.com",
"test3@email.com",
"test4@email.com",
"test5@email.com")
function Check() {

<------ Our Reconfigurations ------>

<script language="javascript">
<!--
//These are the names of the people you don't want

//To add a person, just put their name in quotation marks
//and add a comma after
Names = new Array(
"test1@email.com",
"test2@email.com",
"test3@email.com",
"test4@email.com",
"test5@email.com",
"chickenhead",
"beanbag",
"thunderchicken",
"bozotheclown",
"thedork",
"napoleandynamite")
function Check() {

Notice     in the above where and howto add names into the "Access Denied" section. Look closely and you will see that the final name on the list "Does Not" have a comma (,) after the quotation mark. Be sure you make any additions to the list above the last entry where there is no comma. In other words, the last entry on the list will be without a comma.

For Your Information For your Information:     Two points we need to make you aware of when entering names,email addresses etc, into this section.

  1. All entries must be lower case. The script will not accept UPPER CASE letters.
  2. There are no spaces allowed between letters, numbers, characters etc. If you want to have a dividing area between words such as thunderchicken, you can use the underscore or the dash to separate the two words. See below:
  3. Correct Way: thunder-chicken or thunder_chicken
  4. Incorrect Way: thunder chicken

The only other reconfiguration that can be made is that of the access denied message. See below:

      while (awdrgy<=Names.length-1 && aLeRt!=1) {
            if (namechk==Names[awdrgy]) {
                aLeRt = 1
                alert("You do not have privileges to use this form")
                  document.FORM.FIELD.value=""
              }
              awdrgy++
        }
}
-->
</script>

Once you have all the names and message configured, the only thing left is to incorporate the <BODY> section of code into a functioning form.

Add-On Not Included In Script Little Extra Not Included In The Script:     The last this we shall cover is to make the <HEAD> section of the script into an external.js file and called from an external location. Reason you may want to do this is quite simple. It is to avoid people viewing your source code and seeing who and what names, email addresses, user names etc. you have blocked. If you need a little refresher on howto, see below.

The <HEAD> section of code starts and ends with opening and closing JavaScript tags, See below:

  • Opens With:
    <SCRIPT LANGUAGE="JavaScript">

    <HEAD> Section of code goes here

  • Closes With:
    // End -->
    </script>
  1. Remove the opening and closing JavaScript tags.
  2. Copy/cut and paste everything in-between into a notepad and save it as formScreener.js*
  3. The newly created (Saved As) file will look something like this   formScreener.js
  4. Upload the newly created formScreener.js into your directory
  5. Paste the below snipplet of code into the <HEAD> section of your document to call formScreener.js
    <script type="text/javascript" src="formScreener.js"> </script>
  6. If you have uploaded the formScreener.js into a different directory, you will have to change the path of the above to reflect the location.
  7. If changing the path is a little confusing, grab the below link and it is explained in detail.
    Upload To Different Directory ]
* We named our external.js file formScreener.js. This is just so we know what it is to at any given moment. You can name it anything you want. This is entirely up to you on this.

If you would like to see an example of this effect with the use of an external.js file in the <HEAD> section, grab the below link and you are there.
Form Screener With External.JS File ]

We hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our FAQ ] and if you can't find the answer there, contact us ].
Get Code Here ]   [ Rate This Page ]