HTML - Javascript - input condition -
ive been looking cant seem find clarification... creating form - if user select option contact "email", user must enter text value email input type.
here fiddle- https://jsfiddle.net/4s3blf65/
if ($("input[name='option']").val()=='email') &&($("input[name='email1']").val() == '') { alert('enter email'); return false; }
i cant seem figure out proper syntax js... suggestions?
try way:
if ($("input[name='option']:checked").val()=='email' && $("input[name='email1']").val() == '') { alert('enter email'); return false; }
Comments
Post a Comment