I have many input elements (basically a form page) but for now, let’s just talk about one:
<input class="forms-input form-control DateField" id="AMO-DMI-BPO-Ext-v2019:INSP_DATE" onchange="ExecuteFormula('AMO-DMI-BPO-Ext-v2019:INSP_DATE')" style="font-family:Calibri;font-size:12.2666666666667px;color:#000000;visibility:visible" type="text" value="">
now, i want to update the value of this input without using javascript’s .value
.textContent
or .innerHTML
why you ask? Because when I save the form session and reload it, the
form first of all strips all the DOM changes that are done via client
side, and then takes the added fields values and updates in the
backend.
so, if i do something like:
let DateGenerator = new Date().toLocaleDateString('en-US', {year: 'numeric', month: '2-digit', day: '2-digit'});
document.getElementById('AMO-DMI-BPO-Ext-v2019:INSP_DATE').value = DateGenerator;
it would show me the value inserted in the field but when I save the form, and reload it, it would be gone.. But if i manually add the data (let’s say the date) by click the input field, and then adding the value it just accepts it. Upon saving and reloading the page, it won’t budge about it..
After saving the value = "06/14/2024"
is automatically updated (from the server-side).
<input class="forms-input form-control DateField" id="AMO-DMI-BPO-Ext-v2019:INSP_DATE" onchange="ExecuteFormula('AMO-DMI-BPO-Ext-v2019:INSP_DATE')" style="font-family:Calibri;font-size:12.2666666666667px;color:#000000;visibility:visible" type="text" value="06/14/2024">
So, basically to me, it looks like a challange.. I am trying to do a Data Entry job, which requires unnessaray needed to type same details over and over. Anyways, can we insert the value without doning changes to the DOM, and just use the element ID to identify and put the value in it?