Automatically submitting forms with AJAX