deal with form submit and ajax request