JS form Verification

Source: Internet
Author: User

functionOne () {varGroup = document.getElementById ("group"). Value;if(Group = = "") {Alert ("Group cannot be empty");return false;}varSS = document.getElementById ("ss"). Value;if(ss = = "") {Alert ("City cannot be empty");return false;}varSSS = document.getElementById ("SSS"). Value;if(SSS = = "") {Alert ("The county cannot be empty");return false;}}functionBoth () {varName = document.getElementById ("name"). Value;if(Name = = "") {alert ("The name cannot be empty");return false;}varPSW = document.getElementById ("PSW"). Value;if(PSW = = "") {Alert ("Password cannot be null");return false;}varNumber = document.getElementById ("number"). Value;if(Number = = "") {Alert ("mobile phone number cannot be empty");return false;}varGroups = document.getElementById ("groups"). Value;if(Groups = = "") {Alert ("Group cannot be empty");return false;}varGSS = document.getElementById ("GSS"). Value;if(GSS = = "") {Alert ("City cannot be empty");return false;}varGsss = document.getElementById ("Gsss"). Value;if(Gsss = = "") {Alert ("The county cannot be empty");return false;}}functionthree () {varUpname = document.getElementById ("Upname"). Value;if(Upname = = "") {alert ("The name cannot be empty");return false;}varUPPSW = document.getElementById ("UPPSW"). Value;if(UPPSW = = "") {Alert ("Password cannot be null");return false;}varUpnumber = document.getElementById ("Upnumber"). Value;if(Upnumber = = "") {Alert ("mobile phone number cannot be empty");return false;}varUpgroup = document.getElementById ("Upgroup"). Value;if(Upgroup = = "") {Alert ("Group cannot be empty");return false;}varUPSs = document.getElementById ("UPSs"). Value;if(UPSs = = "") {Alert ("City cannot be empty");return false;}varUpsss = document.getElementById ("Upsss"). Value;if(Upsss = = "") {Alert ("The county cannot be empty");return false;}}

<form action= "pup.php" method= "POST" onsubmit= "return Three ()" >

And so on

JS form Verification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.