Convert form to use AJAX