I was looking for an answer to this problem, but can't get this to work:
<script type="text/javascript">
$(document).ready(function (){
validate();
$('#contact_subject').change(validate);
});
function validate(){
if ($('#contact_subject').val().length > 0 {
$('button').prop('disabled', false);
}
else {
$('button').prop('disabled', true);
}
}
</script>
I want to make sure that it #contact_subjecthas data or disable the button.
source
share