So I have a form option list with several options for booking status:
- Submitted For Approval
- Approved
- Assigned
- Started
- Stopped
- Ended
- Rejected
so in my hook files tablename-dv.js I have the following code:
Code: Select all
//disable Started;;Stopped;;Ended booking_status list options
var op = document.getElementById("booking_status").getElementsByTagName("option");
for (var i = 0; i < op.length; i++) {
// lowercase comparison for case-insensitivity
if (op[i].value == "Started") {
op[i].disabled = true;
}
if (op[i].value == "Stopped") {
op[i].disabled = true;
}
if (op[i].value == "Ended") {
op[i].disabled = true;
}
}
I hope this will save someone some day !! cheers