 In this module, we will talk about something which is called as the validation. If you recall in the prior module, I very very briefly gave you an introduction about JavaScript and I told you that JavaScript is used for client-side validation, so this module will give a brief overview and some of the pitfalls which the program has fallen to because of JavaScript validation. So it is very useful. Now what the JavaScript does is that it tries to ensure, it ensures, tries to ensure, cannot guarantee, it tries to ensure that the data which is filled into the form is as, is correct. Not cementically correct, but it is correct as per the requirement, right. Now what was happening before, actually JavaScript is in use for quite a while for the purpose of form validation, but before JavaScript was there, there were the browsers and in the browsers, there were forms, text boxes, radio button, check boxes and the users entered the data in the form and the browser transferred that data in the HTML page to the web server and the web server checked what were the contents in this form and the contents were correct or not, right. That is called as the server-side validation, right. Though the checking is taking place at the, at the database server, it could be the application server also but usually it's a database server, right. And in the client-side validation, we use the JavaScript to check the correctness at the client which is the browser, okay. So let me give you one example over here. So you start in and there's a page and on that page, there is a alert box and the box is asking something from you, okay, asking you to give the name, right, asking to give the name. Now if you type numerics over here or if you don't type anything and you just submit this Q repress this button over here, okay, then there are two options. One is that you give something which is correct, which is here or you give something which is incorrect, which is here, okay. So it will say that a name is required which is shown by this red circle over here, right. So this is the validation. So asking and when the name was confirmed is generated the hello message and I click on this okay and I move on to the next page or I move on to the next task or whatever is required in the next site. Now the thing is that the JavaScript as I said that people have been using in for validating with JavaScript, validating with jQuery also. Now in this course, we will be using JavaScript for the purpose of validation, not jQuery. And remember that when the form is filled, you type something in the form, okay, then there are different commands for JavaScript to read the contents of that that it could be a text box, it could be a radio button for the case of radio buttons, there is a grouping. So they are logically grouped together, they have the same label also because only one value of the radio button is selected at a time is considered at a time as opposed to check boxes where you can have multiple values. I believe you understand this, right or not. Now, this is one thing over here that we can work with these boxes and radio buttons also, which I will be talking about over here is the hacking of the JavaScript validation, hacking of the JavaScript validation. Now if you recall in the prior module, I spoke about the dollar underscore get and dollar underscore post also. What they are doing is that they are passing the commands to the server. And those and if I can circumvent this, if I can circumvent this, then I can be doing things which I am not supposed to do, right or not. Now before I go into more detail, one point is to be remembered is that JavaScript is running on the browser, on my browser, I am the client. I have the option of turning off the JavaScript, right, and I can do it on purpose or I can do or that person who has turned off the JavaScript may have malicious intents, okay, may want to run something on the database server, okay, through the web server without validating on the client end. There are many, many programmers, okay, who kind of boast and they say, we are fine, we are safe. Why? Because we have done client side validation in the JavaScript. But remember, remember that anybody can turn off the JavaScript and that validation is no use. Let me go into more details. Hacking JavaScript validation, what, what is going to happen? Say, I give you one, one example over here that if I turn off the JavaScript, what's going to happen? Say, for example, I submit the data and there is a range of numbers which I am allowed to submit, say between one and three, right? And based upon the data which I submit and order is generated. If I turn on the JavaScript, this is fine. It will check. But if I turn off the JavaScript, then I can enter negative numbers also that will confuse the server or I can enter data more than three and that data will be passed to the server database server and it will make a wrong order. You see, you can play with JavaScript.