Remove option from dropdown list after submitting choice

Hi,

Could I get some guidance on the code below?
When a customer selects a number from the dropdown list, enters their email and clicks submit, the chosen number and email goes into the database. However when this number is chosen I want this number removed from the dropdown list so a future customer cannot select the same number again. Any help much appreciated.

Thanks,
Calvin

import wixData from ‘wix-data’;

function onClick (selectnumber) {

function removeOptions(selectnumber_click)
{
var dropdowndelete = removeOptions(‘onedropdown’)
for (selectnumber-1;dropdowndelete>=0;dropdowndelete–)
{
if (selectnumber.options[dropdowndelete].selected)
selectnumber.remove(dropdowndelete);
}
}
}

I’d do it like this:
In my “Options” database collection I’d have the following fields:
optionValue (string)
isUnavailable: (boolean)

for the dropdown options, I’d filter the dataset (or define the database query), so if isUnavailable === ture, it won’t be included in the dropdown options.
Once a user has submitted an option, I’d update the database record and change the isUnavailable to be true.