Forms Introduction Javascript Essential Training

Forms Introduction Javascript Essential Training

Javascript, TUTORIALS, WEB

Forms Introduction Javascript Essential Training




In this lesson Forms Introduction Javascript Essential Training we are gonna learn one of the main important function which is known as Form Validation as we told in earlier lessons. In javascript We purposefully use some main events for forms like onsubmit, onchange and few more. These functions are works on the form validation and always check the conditions of the form contents are given as correct or not.
When comes to the form elements we have to consider the field values, and then the events called by fields values. We can provide ids for the form and also the form elements for getting the elements by using that ID.
Getting Form and Form Elements – Forms Introduction Javascript Essential Training
For example consider the following example for how we naming the form elements and form naming. In the below given form we can access the entire form by its id frmContact. And each element can be accessed using their individual id itself, each element has separate name depends on their purpose.

Forms Introduction Javascript Essential Training
In the above image we shown how we consider the form elements by its id and the over all Form. Now you can create what ever effect or the back end process using this id for over all or individual form elements. (For the above example we are using the bootstrap frame work for some clean code)




Text elements one of the main property is myTextField.value and each elements are consider their own id for individual elements. And the some of the main Events occur in form elements are onfocus(), onblur(), onchange(), onkeypress(), onkeyup() and onkeydoen() the onfocus() is runs when the mouse is hover on the element and the onblur() is executes when we leave the element.
Checkbox and Radio Buttons – Forms Introduction Javascript Essential Training
When we comes to the forms concept, there is some another important features we have to discuss are check box and the radio buttons. The main property of this are checked whether it is enabled or disable. And the events we can expect to occur is the onclick on the check box and radio buttons.
The select lists are the another considerable element in this Forms Introduction Javascript Essential Training lesson. We also consider these things also in drop down lists and the select lists. One of the main property we can use here is, mySelect.type (Select one – or – select Multiples)
We can find this single select by this property like, mySelect.selectedIndec(), in any case if it is a multiple select then we can use like this, mySelect.options[x].selectedIndex[] Properties.

Forms Introduction Javascript Essential Training
The above properties are can handle the event which is called as onchange of the select list item.
Form Events – Forms Introduction Javascript Essential Training
For ultimately there is one event we have to remember in this forms concept is the submit event. We can find this event at the bottom of the form which can take the values to the next level is submit button. We can use this onsubmit for various purpose and we learn about them in the upcoming lessons.




We hope this lesson will gives you some knowledge on the Forms Introduction Javascript Essential Training and we can learn more about these kind of events and properties in the upcoming lessons.

Leave a Reply