I want to keep the user from changing values in certain ConfiForm fields within a TableView macro after a certain date. Basically, I want to make all the previous weeks' fields readonly. I have JavaScript that figures out what "today" is and what week of the year it is. I have my fields named for those weeks. I have the code, what I'm trying to get are the HTML id's that will allow me to access those fields and make them ready only. Alternatively, I need a way tick the "Disable Inline Edit" box in the Form Field macro in JavaScript in the AJS.toInit function. Any ideas?
Ok. My collague fiugred it out. In my for loop in my AJS.toInit function, I needed:
let fieldname = "td.cfgrid.cf_week"+i.toString()+"hours";
document.querySelectorAll(fieldname)[0].style.pointerEvents = "none";
The above basically has the effect of checking the "Disable Inline Edit" box, but in JavaScript.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.