I have several jquery datepickers on my asp page and I want to set the defaultdate of date picker to be the same as the previous datepicker.
I am currently using
defaultDate: document.getElementById('<%=txtFirst开发者_运维知识库Date.ClientID%>').value
This works okay, but obviously errors if firstDate is null. Should I be using OnSelect function instead?
Appreciate any help
var defaultDate = document.getElementById('<%=txtFirstDate.ClientID%>').value;
defaultDate: defaultDate || 'default-value'
精彩评论