Fill field depending on checkbox selection
Hello
I have 3 checkboxes for class timings and the person can only choose 1 of the 3.
Depending on the checkbox ticked, a text field at the bottom (called (txtOfficeClass) is filled with text.
I have searched the forum and placed the following scripts (mouseup) in each check box. It works, but i want to know if i have done in correctly (in case something wrong happens in the future)
CheckBox 1
(function ()
{ // Get a reference to the text field var f = getField("txtOfficeClass"); if (event.target.value === "Off") {
f.value = ""; // Blank the statement field
f.readonly = false; // Allow user to enter text } else {
f.value = "CLASS 1 (16:30 TO 18:00)"; // Set field text
f.readonly = true; // Don't allow user to enter text }
})();

