With most attributes, you can prepend the attribute name with dmx-bind: to make it a dynamic value. Looks like you have to do this in code for these… assuming you’ve looked under dynamic attributes already.
I call myself doing this but like most things, I probably got it wrong, lol. I will give it another shot knowing that is where I need to add it.
Thanks.
I have a form that allows the user to pick the submission month.
Based on this, I'd like to display two fields, start and end days.
The days displayed should be calendar days for the selected month above.
If they change the month, the start/enddate available should be refreshed.
Althoug I managed to get this reflected in the code, the widget itself doesn't seem to reload with the new start/enddate values.
Edit the JS goal is to set the first day of the month in input field "startDate", based on the selected month, as well as define the calendar pick range.
function setStartDate() {
var month = document.getElementById('addMonth').value;
var year = document.getElementById('addYear').value;
var startDate = '1/'+month+'/'+year;
var lastDay = new Date(year, month, 0).getDate();
var startDateInput = document.getElementById('addStartDate');
var monthTwoDigits= (month<10?'0'+month:month);
var lastDayTwoDigits= (lastDay<10?'0'+lastDay:lastDay);
startDateInput.value = startDate;
startDateInput.removeAttribute('mindate');
startDateInput.removeAttribute('maxdate');
startDateInput.removeAttribute('startdate');
startDateInput.removeAttribute('enddate');
startDateInput.setAttribute('startdate', year+'-'+monthTwoDigits+'-'+'01');
startDateInput.setAttribute('enddate', year+'-'+monthTwoDigits+'-'+lastDayTwoDigits);
startDateInput.setAttribute('mindate', year+'-'+monthTwoDigits+'-'+'01');
startDateInput.setAttribute('maxdate', year+'-'+monthTwoDigits+'-'+lastDayTwoDigits);
//dmx.app.set('minStartDateVar.datetime', year+'-'+monthTwoDigits+'-'+'1');
//console.log("start date:"+startDate);
}
Thank you so much! I'd love to get rid of the JS code.
I had previously tried with binds, but to no avail.
Somehow it doesn't seem to do be updating the start/end date range, with the proposed option above.
I have made a few tweaks as the month input field is not populated by default