If you are hoping to undertake a web coding project, you will need to know how web forms work. A web form is a little data-gathering machine. What kinds of data can it gather? You name it:
- Text, from a single word up to a long post
- Numbers, dates, and times
- Which item is (or items are) selected in a list
- Whether a checkbox is selected
- Which one of a group of radio buttons is selected
The Server Street route means that your web server gets in on the action. Here are the basic steps that occur:
- The user clicks a button to submit the form.
- Your JavaScript/jQuery code gathers and readies the form data for sending.
- The code uses an Ajax call to send the form data to a PHP script on the server.
- The PHP script extracts the form data.
- PHP uses some or all of the form data to build and execute a MySQL query.
- PHP outputs either the requested data or some kind of code that indicates the result of the operation.
- Your JavaScript/jQuery code processes the data returned by the server and updates the web page accordingly.
- The user changes the form data in some way.
- Your JavaScript/jQuery code detects the changed data.
- The event handler for the changed form field updates the web page based on the changed data.