•      By default HTML is used to control appearance. The webpage created in HTML is Static, and after the browser renders it can not be changed. On the other hand, with the development of the Internet, people are expected to get better acquisition and visualization. But HTML can only provide unchanging webpage. Thus, the need for more dialogue in the new programming language of the Web arises. So Netscape developed Javascript JavaScript is a skating language that lets you add programming aspect to a webpage.
  •      Fitting language is a simple and light programming language, which does not include the latest tasks like ‘C’ or ‘Java’ language. Javascript is used on the webpage to improve website graphs and verify the validity of the form. It adds dialog to HTML page. And it is added directly to the HTML code. Currently, all web browsers like Mozilla Firefox, Com, Safari and Internet application support JavaScript. The webpage does not remain unchanged after using JavaScript, but can include code for dynamic communication, browser control, and dynamic presentation of HTML details.
  •      We saw how to create a form using a composer. When the user adds details to the form, it will also leave some important fields blank or add details to the field in the wrong form. In such cases it is necessary to provide some precision. Reality prevents users from making mistakes. When a user adds a bad detail or leaves the field blank, an error message should be displayed and the form must be stopped after submission.
  •      Currently, Javascript is the most common appropriately client-side script, which is run in the web browser. Javascript is used to verify its accuracy on the client side before the details added in the HTML form are sent to all. Using Javascript is usually checked in the form below?
  •    Has the user left the required field blank?
  • Has the user entered the correct e – mail address?
  •    Do the details of two fields are identical or not?
  •    Has the user entered the correct date?
  •    Has the user added text to the numeric field? For example, text has been added to the older (Leu) field, for example, instead of numeric details in the field for the quantity, the user enters literally details
  •     How to test the validity of the form, learn how to write a JavaScript code before studying.
  •     JavaScript code is implemented only in HTML webpage. Thus, JavaScript code can be directly embedded in the webpage as an independent section. The javascript code is added using the <script> </ script> tag in the HTML page. The lines between the <script> and </ script> tags contain the JavaScript code. Remember, the JavaScript case – the sensitivity ‘Is the language.
  •      Javascript is included in HTML’s or section, but it is more desirable to add code to the tag.
  •      It can be seen that, only one statement in the <script> tag is written “document.write (‘” HELLO STUDENTS “)”. Here is a process that is a part of the document royalty, which is text-oriented, it is given as a document write variable. Semicolon given in the end of the statement in the figure is optional in JavaScript; semicolon marks are used for separation rather than termination. So if every statement is written in the V-line, then there is no need to put a semicolon. Document in our example The semicolon after the write statement will be deleted even then the result will be equal. However, the use of semicolon is a good programming practice. Figure 2. The result of code in 14 is displayed in the browser.

  • Note: JavaScript statements can be collected in a block form. The beginning and end of the block is done by the Sixth Kos ({}). Now, learn how to write simple javascript for the validity of the form. First, we create a simple form with two fields: name field and submit button. For the validity of the form, if the user names the field blank and click on the submit button, a message to add a name to the user should be displayed. Follow these steps for this action:


Please enter your comment!
Please enter your name here