I have 3 date range forms on my site. Essentially I want to hide two of the date ranges and only show the user one. However, I still need the value’s chosen in the one date range to be distributed to the other date ranges. I tried applying the VAL of the first date range to a variable before click and applying it to the other inputs, but it doesn’t seem to be working.
$('#edit-submit-calendar-full').click(function(){
var startDate = $('#edit-fd-min-datepicker-popup-1').val();
var endDate = $('#edit-fd-max-datepicker-popup-1').val();
$('#edit-fw-min-datepicker-popup-1').val(startDate);
$('#edit-fw-min-datepicker-popup-1').val(endDate);
$('#edit-sd-min-datepicker-popup-1').val(startDate);
$('#edit-sd-min-datepicker-popup-1').val(endDate);
});
EDIT: This does seem to be working for this basic example, but when it redirects to another page, the inputs never get filled in. Doing some more testing.
It turns out that I had an error with my selectors. The code above works properly.