ajax validation and submition for registration