You are viewing limited content. For full access, please sign in.

Question

Question

Exclude dates on calendar field

asked on February 3, 2017 • Show version history

Good morning,

One of our forms has a calendar field where submitter's can pick the desired date. We were wanting to know if we could make a few changes:

1. make today's(current day) date unavailable

2. make all Saturdays and Sundays unavailable

 

Thanks,

Tiffany

0 0

Replies

replied on February 15, 2017

yes it is feasable by using script, I did something similar, but just to disable all days before a starting date.

here the code I used for this one

//code for sarting and ending date

$(function() {
$(document).ready(function(){

// Updated code below
  function updateMinimumEndDate () {
    var minimum = $('.StartDate input').val();
    var minSplit = [];
    minSplit = minimum.split("/");
    var newMin = (minSplit[2]+"-"+minSplit[0]+"-"+minSplit[1]);
    $('.EndDate input').attr('min',newMin);
  //  alert('newMin');  // Comment this out after you confirm it's showing you the alert, which will indicate this is running properly
  }

  $('.StartDate input').change(updateMinimumEndDate);
});
});

//End date code

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.