Hi Guys,
Can you help me to correct this JQuery code below? This is supposed to be for a SharePoint 2010 list form with a dropdown list named ResponseTime and Single line of text field named DueDateField. ResponseTime has 2 choices namely Normal and Urgent. May we ask guys if we should we replace #dropdown with ResponseTime? Also, as we would like the result date to be inserted on this text field (DueDateField) in the list form, did we code it correctly? Please advise.
$(document).ready(function() {
$('#dropdown').change(function() {
dropdown = $('#dropdown').val();
var CurrentDate = today.getDate();
var DueDate;
if (dropdown == 'Normal')
{
DueDate = CurrentDate + 15 days
$("DueDateField").val(DueDate);
}
else if (dropdown == 'Urgent')
{
DueDate = CurrentDate + 7 days
$("DueDateField").val(DueDate);
}
});
});Thank You,