Home > Web Front-end > JS Tutorial > JavaScript guestbook program code page 1/3_javascript skills

JavaScript guestbook program code page 1/3_javascript skills

PHP中文网
Release: 2016-05-16 19:01:05
Original
843 people have browsed it

How to program a guestbook? Guestbook programming is not difficult, and there are many options for implementing it, such as CGI programs and more. This article introduces how to use JavaScript to program a guestbook. Below is a complete example.

----We provide a form with name, email address of the guest, browser version used, country name, comments and suggestions, favorite sites, etc. After the guest fills out these fields, press the Submit button, and the information will be emailed to you. The program provides several functions, most of which are used to check the validity of fields. Below we give a brief explanation of the function.
----Function Reset() resets the contents of each field after pressing the Reset button.
----The function submitForms() presses the submit button and checks the validity of the fields before sending an email.
----The function isName() checks the validity of the name field.
----The function isEmail() checks the validity of the email address field.
----The function isBrowser() compares the browser field with the automatically detected browser version.
----The function isCountry() checks the validity of the country field.
----The function isComment() checks the validity of the opinion field and does not allow null values.
----The function isFavorite() checks the validity of the favorite site field and does not allow null values.
----The program also provides some skills, such as how to determine the browser version, string operations, etc.
----The results are provided to you in the form of an email with various fields entered by the guest. The program is relatively long, but not difficult to understand. Here is the source code:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template