Why does the $('#select_embed') property get set to true, but not to false? Instead, I tried removeAttribute('required'), but that didn't work either.
<script>
function showBundles(){
if (document.getElementById("embed").checked){
$('#div_embed_bundles').show('fast')
$('#select_embed').prop('required',true);
}
else {
$('#div_embed_bundles').hide('fast')
$('#select_embed').prop('required',false);
}
}
</script>
Ideally if prop('required',true)
is working then prop('required',false)
should also work. But you can try with removeAttr
, hope this helps.
function showBundles(){
if (document.getElementById("embed").checked){
$('#div_embed_bundles').show('fast')
$('#select_embed').prop('required',true);
}
else {
$('#div_embed_bundles').hide('fast')
$('#select_embed').removeAttr('required');
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With