In my last post I talked about how to add links to other pages with Colorbox. This post is about how to handle Ajax forms with Colorbox. You may have noticed that when you submit a form from within Colorbox, it does a HTTP request rather than an Ajax request. This can be somewhat frustrating – especially if you are wanting to have your form submit via Ajax.
In this post we will cover the following:
- Create a small form with required fields.
- Create PHP processing to check the required fields.
- Open the form with Colorbox.
- Submit the form via Ajax and show the results in Colorbox.