This is my code, it hides and shows the checkboxes just fine, only the boxes are not checked or unchecked. I use this in the WordPress Form 7 plugin.
$("#haaldatum").change(function() {
var curDateH = $("#haaldatum").datepicker('getDate');
var dayNameH = $.datepicker.formatDate('DD', curDateH);
if (dayNameH == "zaterdag") {
$("#haaltijdzat").show().prop( "checked", true );
$("#haaltijd").hide().prop( "checked", false );
}
else{
$("#haaltijdzat").hide().prop( "checked", false );
$("#haaltijd").show().prop( "checked", false );
}
Aucun commentaire:
Enregistrer un commentaire