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

Question

Question

Is there a way for a date to be calculated to meet requirements for an event?

asked on February 25, 2015

i am trying to find a way to calculate dates.  for our event security requests forms need to be filled out 10 days prior to event.  if they do not meet these requirements then i want to make a rule to fill out a different form on a different link.  is this possible?

0 0

Replies

replied on February 25, 2015

You should be able to do this using JavaScript. You would need to probably do a database lookup that would populate the event date first. Then using JavaScript, take the event date and calculate 10 days out and then see if the current date is 10 days prior to the event. I would then have the JavaScript fill in another field with a yes or no value depending on the answer. Depending on that value, I would then use JavaScript to disable the submit button and show a custom html field that contains the link you want them to click on for the other form.

0 0
replied on September 24, 2015

Is there any way you could show me what the java script would look like for example if I want to take the submit_date from one form and on the next form have a due_date equal to the submit_date + 20 days?

 

0 0
replied on December 13, 2016

$(document).ready(function(){
//set due_date to today plus 20
  var dueDate = $('submit_date input').datepicker('getDate','+20d');
  dueDate.setDate(dueDate.getDate()+20);
  $('due_date input').datepicker('setDate', dueDate);

})  //close document.ready

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

Sign in to reply to this post.