This Javascript Form is offered to those who are capable of understanding SOME Javascript. I have tried to simplify the form requirements by adding NOTES at the bottom of the page for MODIFYING the form. Often people are able to determine how a Javascript operates by "viewing" it and studying the elements and then "tinkering" with it until it operates to meet their needs. That is what is intended in this case. The script is offered AS IS, with NO responsibility assumed for DAMAGE or problems caused through it's use.
Using this Javascript Form will "FREE" you of using the Yahoo!GeoCities mail service and having to FORWARD the form to your REGULAR mail server. It will send the form DIRECTLY to your REGULAR mail server.
1. Near the beginning of the form script you will find - function leaptoIntro()
This is the location you should place the page where you wish people to go after clicking the the CLOSE button at the bottom of the form. I have used it to direct people to a Thank You page
with a LINK to the Main HTML Help Page from there.
2. Next comes the - function About()
This is where you need to REPLACE the TEXT I have inserted to tell people who want to know what the form is FOR/ABOUT when they CLICK on the ABOUT button at the bottom of the form.
3. Next comes the - function Reset()
This is more involved and can be extremely confusing. If you understand some JS it will not be nearly as confusing. Regardless, this is where you set the attributes to which the user will be RESET if they attempt to SUBMIT the form without completing the areas you specify there which MUST be completed. It will cause an ALERT to "popup" telling them they have left something BLANK and when they close the alert it will take the cursor automatically to that point they have NOT completed.
If you look at the example above you will see the "elements" which must be completed are: 1, 2, 4, and 15. These are the NAME, BROWSER/VERSION, E-Mail address and the COMMENTS sections. It is
probably a good idea NOT to require any "input" for the URL of the person as many will not have one as yet, or may never have one.
To determine the NUMBER of the ELEMENT to place in the [ ] location in the JS just COUNT each item from the TOP of the form which may be used as an input. Look at the DISPLAYED page of the FORM and you will see there is a LOCATION to input the 1.) NAME, 2.) BROWSER/VERSION, 3.) URL, 4.) E-MAIL ADDRESS, then 5.) 5 radio buttons under the 1st question, 6.) 4 radio buttons under the 2nd question 7.) 1 input window for a selection in the 3rd question and 8. the TEXTAREA for the COMMENTS. If you add them all up you can see how I arrive at 15 for the TEXTAREA in the RESET.
4. Next comes the - function submitForm()
This is where you define each area which is to be checked for completion upon CLICKING the SUBMIT button. Notice in this example I have FOUR (4) areas set for "checking." They are listed in this manner ((isName()) && (isBrowser()) && (isEmail()) && (isComments()). For each the script will check for completion by checking TRUE or FALSE and will take the appropriate action. It will RESET after sending an ALERT which must be CLICKED and resetting the cursor to the area which is NOT completed. You will have to ADD another AREA to this line if you want it to be checked.
5. Next comes the INDIVIDUAL coding which the script checks to ensure the information in each area is completed or not. Each area identified in (4.) above, must be defined in this area. For areas other than the ones already indicated you should ADD a similarly coded line. Remember, you need to have an entry here for each area in the paragraph above.
This is difficult to explain and some "tinkering" on your part may be needed to see exactly how the script operates.
Briefly, to repeat, you will have to "identify" each area you want "checked" in the "function Reset()" area...then you need to include each area in the "function submitForm()" line where they will be checked when the SUBMIT button is clicked, and last...you need to "expand each definition" in the following lines.
Addition of the ONLOAD Event Handler is fairly self-explanatory. Just add - onLoad="Reset() - to the
tag.
ADDING the HTML to your script:
The first FOUR (4) areas, the NAME, BROWSER/VERSION, URL, and E-MAIL will probably be retained in most forms. Those are already coded in the script and should be left as is, for the most part.
The AREAS which you wish to include beneath those first FOUR can be any type acceptable in all forms. For help with that go to the Main Frame page. Each type is explained.
You can ADD TO, DELETE, or MODIFY the existing areas as needed. Studying the areas will allow you to see where the TEXT should be added for each area.
After you have the AREAS/QUESTIONS added you will have to include the HTML for the BUTTONS. Unless you want to DELETE one of the buttons for some reason (I would leave them as is) you just use the coding as is. You can study the buttons and the information they present ABOVE in the FIRST section of the form.