How can I manipulate the DatePicker attribute with my own JavaScript? The object itself is a JavaScript construct, so I figure it's possible - I just haven't figured out how.
For example, I have some custom js code on my task screen that pulls elements and then performs basic DOM actions like these:
var usersContractEndDate = document.getElementById("UsersContractEndDate");
usersContractEndDate.disabled = "true";
I perform conditional actions like this one based on on-screen fields in a similar way that you can do with in-task validation javascript, except this is faster and causes less headaches for my users. This is why:
IM's native "Validate on change" attribute option is not local on the browser. A changed attribute submits the entire task page to the server, and it will come back with validations for every single field - even for those not filled in yet.
As a result I can have over a dozen of red error messages on the top of the page for fields that weren't yet filled in, yet "failed validation" because they're marked as required attributes. It's also unnecessarily slow. If I want to enable an attribute text input field because of a checkbox, I (as well as my users) want that instantly. No submissions needed. Just onchange() the button and enable() the text input for the attribute. Done. Instantaneously.
All I want is a "validate on change" for one attribute when that attribute is changed, ignoring any other possible wrong or empty attributes. Just validate the one attribute that was triggered. Because IM can't do that, I wrote my own onkeypress, onclick and onchange handlers, and use them accordingly.
I'm trying to do the same with this datepicker object. Based on the value of dropdown on screen, I want to either enable or disable the datepicker, and for the reasons stated, I do not want to use the native 'validate on change' functionality.
So, to summarize, how I can enable/disable the datepicker attribute object through JavaScript?