- Fri Jan 27, 2017 8:08 pm
#788798
The setValue() method currently does not work to clear a datetime field.
Until this bug gets fixed, the way to clear a datetime field in ProcessMaker 3 is to use this JavaScript code:
Until this bug gets fixed, the way to clear a datetime field in ProcessMaker 3 is to use this JavaScript code:
Code: Select all
For example, a DynaForm has a datetime field with the ID of "dueDate". A button is added next to the datetime field with the ID of "clearDate". The following code is used to clear the "dueDate" field:
$("[id='form[datetimeID]']").val('');
$("[id='form[datetimeID_label]']").val('');
getFieldById("datetimeID").model.attributes.data.label='';
getFieldById("datetimeID").model.attributes.data.value='';
Code: Select all
$("#clearDate").click( function() {
$("[id='form[dueDate]']").val('');
$("[id='form[dueDate_label]']").val('');
getFieldById("dueDate").model.attributes.data.label='';
getFieldById("dueDate").model.attributes.data.value='';
})