javascript - Make form fields required only if a file is not attached/uplodad? -
i have page job application form users can fill in contact info, , either upload resume document, or fill out rest of form.
the problem is, need make fields required if there no resume attached. splitting separate forms not option.
is there way use javascript require fields when there no resume attached?
or alternatively, automatically fill in required fields "see resume" when user attaches resume file?
you can bind change
handler file input element , update required fields so:
$('#myfileinput').change(function() { $('.myrequiredfield').val("see resume"); });
Comments
Post a Comment