Hi everyone.
I have a form that needs to automatically make the end date the same as the start date based on whether the drop down option "Annual Leave Half Day" is selected. The code works fine when the fields are not within a collection. How can i change this code to work within a collection?
- Field15 is the dropdown ID.
- Field13 is the start date date picker
- Field14 is the end date date picker
- 300 is the value of the dropdown "Annual Leave Half Day"
Any help is appreciated.
$(document).change(function() { var $Field15 = $('.leave'); if ($Field15.find(':selected').val()==="300") { var Start = document.getElementById("Field13").value; $('#q14 input').val(Start); } else { // do nothing } });