I'm trying to set default values in a new row of a SharePoint Online list in "Quick Edit" mode using code that looks like the below. The date column works as expected: date value is added but the "Init" and "Project" columns get the value but then behave like there is no value, i.e. I get the message that the fields are required and when I click in them the value disappears.
EntryDateTime, Init, and Project appear to be populated as expected:
Try to save the row, and get error that Init and Project are required, although they appear to have values:
Have to enter the values again manually to get the row to save:
EntryDateTime is working as expected.
Code:
$( document ).ready(function() {
var t = setInterval(function() {
if($("#spgridcontainer_WPQ2_leftpane_mainTable").length) {
clearInterval(t);
var d = formatDate(new Date());
$("#spgridcontainer_WPQ2_leftpane_mainTable tr:last td:eq(1)").text(d);
$("#spgridcontainer_WPQ2_leftpane_mainTable tr:last td:eq(2)").text("TS");
$("#spgridcontainer_WPQ2_leftpane_mainTable tr:last td:eq(7)").text("307");
}
}, 1000);
});