Changing on a specific day of the week a custom field
Hey
I am trying to use ".show() - .hide()" on a specific field when I selecting a specific day of the week.
I have tried a lot of codes lying on the net and without any success.
Day 6 is working and disabling but whats inside "IF" is not working
- jQuery( "#pickup_date" ).datepicker({
- beforeShowDay: function(d) {
- var day = d.getDay();
- if( day != 5 ) {
- jQuery("p#pickup_time_field").hide();
- jQuery("p#pickup_time_friday_field").show();
- }else if( day != 4||day != 3||day != 2||day != 1||day != 0 ){
- jQuery("p#pickup_time_field").show();
- jQuery("p#pickup_time_friday_field").hide();
- }
- return [(day != 6 )];
- }
- });
- jQuery( "#date_num" ).datepicker({
- beforeShowDay: function(d) {
- var day = d.getDay();
- if( day != 5 ) {
- jQuery("p#time_num_friday_field").hide();
- jQuery("p#time_num_field").show();
- }else if( day != 4||day != 3||day != 2||day != 1||day != 0 ){
- jQuery("p#time_num_friday_field").show();
- jQuery("p#time_num_field").hide();
- }
- return [(day != 6 )];
- }
- });