New callback functions for form validation using Ajax.

close #4436