How to convert HTML Forms into AJAX simply
You may have a normal HTML Form, like: contact form, feedback form or any other forms in your website or any website you work on.
Did you think how difficult converting this FORM into AJAX?
Let me say, it will be very simple. Simple as 1 minute of changes.
How is that, right?
Using the ALAJX (a new jQuery plugin) will make it as simple as that. This plugin deals with forms as the following code:
The ALAJAX plugin checks the object, if it is not a form then it will look inside the current object for a form. Then it prevent the form from submitting the data (by clicking on Submit button or by pressing Enter) and it sends the data by AJAX to the URL given in action form property. It also use the form method property to send data by POST or GET.
So, there is nothing you are going to do,
- Include the jQuery plugin in your web page (If its already included then skip this one).
- Include the ALAJAX plugin.. download it from here. You also may check the demo page of this plugin by clicking here.
- Call the plugin to enable it. as:
- You may need to do some update to you Server-Side scripting code.
Hope you enjoy it 🙂