updated preForm and added associated javascript for ajax form handling