Hi, Can anyone help me please??
I had a form with file type input fields. I placed validations for them like if file type is .jpg/.png/.gif ,accept otherwise don't accept. The messages are displaying. I want the text to be emptied when an error occurs. Following is the code i wrote: $j("#post_page_form").validate({ rules:{ post_entry:{ required: true, maxLength:100 }, post_description: { required: true }, post_image_path1: { accept: "(jpe?g|gif|png)" }, post_image_path2: { accept: "(jpe?g|gif|png)" }, post_image_path3: { accept: "(jpe?g|gif|png)" }, post_image_path4: { accept: "(jpe?g|gif|png)" } }, messages:{ post_entry:{ required: "'.errMsg($msg['post_entry_req']).'", maxLength:"'.errMsg("Enter the title only upto 100 characters").'" }, post_description:{ required:"'.errmsg($msg['post_desc_req']).'", maxLength:"'.errMsg("Enter the description only upto 1000 characters").'" }, post_image_path1:{ accept: "'.errMsg2($msg['post_images_check']).'" }, post_image_path2:{ accept: "'.errMsg2($msg['post_images_check']).'" }, post_image_path3:{ accept: "'.errMsg2($msg['post_images_check']).'" }, post_image_path4:{ accept: "'.errMsg2($msg['post_images_check']).'" } } }); When the messages are displayed, I want the fields to be made empty.