Before going in to the topic let us discuss some important terms in layman mode about client, server, scripting language, scripts and so on. Let me explain these concepts to you in brief.
Consider a website is developed in Java. Every website is a project. You should know now, that for executing the project in a local machine, the machine should have some software called a server software. It can be Apache, Tomcat, etc. The computer needs the application software (In this case it could be a JVM). The computer should also have a database application which could be (MySql, Oracle, etc.,). If all the above tools are available in a computer, the project can be executed on that computer. And the computer may now called as a Local Server.
In addition to them, if the computer is connected to Internet, that computer can serve as a server. In this case the computer can be called as a Remote Server.
So let me now tell you in brief what a Server is. A server is a computer which comprises of a Server Software, Application Software, Database needed for the project to be executed on it. If the server is connected to the internet, it may be called as a Remote Server.
A server could serve one or more computers based on its capacity. Let us consider that Gmail.Com in our case, is too located in a Server which is connected to internet. So that we can access the website.
Server Side Scripting Languages:
Server scripting languages are the languages which are used to code the project. The website could be developed using programming language such as C# or VB if the project(website) is developed in .Net. The programming language could be Java if the project(website) is developed in Java. In these cases the languages C#, VB, .Net are called as Server Side Scripting Languages or Server Scripting Languages Since it require a Server software such as a .Net or Java to be installed in server for the execution of the code.
Client Side Scripting Languages:
Validation Necessary or Not:
Now let us come to a decision that whether validation is mandatory or not. Let us discuss. Consider a Gmail Registration Page, there are certain rules for creating an email id such as
- All the fields are mandatory and should not be empty
- FirstName and LastName should not contain Digits
- Email Id should not contain any special characters except . and _
- Password should be atleast 8 characters in length
- Mobile Number should contain only digits and no alphabets should be allowed.
Validations can be performed in two levels, such as
- Basic Validation
- Format Validation
The validations for checking for empty fields are called as Basic Validations. All mandatory fields that should be filled up can be validated using these basic validations.
Format Validation is special type of validation by which a filed is validated against user defined conditions such as FirstName and LastName should not contain Digits, Email Id should not contain any special characters except . and _, Password should be atleast 8 characters in length, Mobile Number should contain only digits and no alphabets should be allowed.
Given below is a code which consist of some fields with format validation.
isNaN( document.myForm.Zip.value )
In this code NaN stands for Not-A-Number. So the code checks the value entered in the ZipCode Field is Not a Number for Not. If it is Not a Number then an alert message must be displayed and the form should not be submitted. So in the IF CONDITION of If(IsNan) we have coded as return false; which means that the form should not be submitted.
document.myForm.Country.value == "-1"
You can note down the option values provided in the HTML code to get the meaning of the code
So, based on the code if the option value is -1 then the form should not be submitted.