..
Validate our client-side form has become very easy due to jQuery, but to be really sure that user input has been provided just as they were expecting is a good idea to duplicate the check out the server side.
But if we use AJAX to communicate with the server (and therefore with PHP for example) we can decide to delegate all the checks directly to the server.
For our example, we obviously need jQuery, PHP and jQuery Ui of the faithful
At the time of writing, the jQuery UI package contains version 1.8.10 and 1.4.4 of the jQuery script, so do not yield to the temptation to use the new jQuery 1.5 which I have described here and "be content" of the proposed bundle.
Choose a topic-neutral theme of roller Ui :

We then go to download what we need:

In the package are downloaded. "Js" useful jquery and jquery-ui-1.4.4.min.js-1.8.10.custom.min.js inside the folder js, css folder inside the same name and we can free ourselves development-bundle folder and file as index.html
We structure all in a tree line and that's the result shows it as Eclipse :

As you can see in the image we have added an index.html file in the root, a index.js in a js and css in style.css, we also created a folder "php" with a file inside: you remote.php take care of server-side validation.
Images in this article to create a simple form for the acquisition of user data in order to save them in a hypothetical database of contacts.
We will focus on validation of the fields entered by the user and not the actual data storage, which is beyond our purposes, it is then enough to put in the correct position of a database call for the inclusion of the information acquired. We will make use of jQuery Ui Component dialog alerts the user to show, so you have something more visually pleasing, modern classics alert provided by the browser.
| |
ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €. |
| |
Javascript (Course)
Complete guide to client-side scripting. From 39 €. |
| |
PHP (Course)
Full course for creating dynamic Web sites. From 49 €. |