restrict options in combobox (First come first served entry booking)
restrict options in combobox (First come first served entry booking)
I am trying to use the restricting option to use inline editing only for specific fields as described here. Now I want to even further restrict the input by allowing only one option or empty field in a combobox. Is that possible?
It should be a foreign key field but allowing only one entry (in the example his own name logged in the system). If there is already one option selected it should not be possible to select his own name any more since already someone else booked the entry. I hope you can follow me. Its a first come first served booking system. If the field is empty you can book your own name in, if not it is locked. How can I apply that to datatables? Is there an example which has similiar behaviour?
Answers
What combo box library are you using? You would probably need to refer to their documentation for that.
Allan
The solution to the problem I found through the help of Allan via message. First of all I meant the standard select box and not the combobox. Here is the solution to just let the user edit if his/her name is shown in the select via the Session variable or the select is empty.
To minimize the options to one I just used the
where
filter to the options list as described here https://editor.datatables.net/manual/php/joins#Options