src/public/js/object_functions.js
/**
 * A helper function that populates a select field.
 *
 * @param select_id The id of the select element to populate
 * @param objects The objects to populate in the select
 */
A helper function that populates a select field.
@param select_id The id of the select element to populate
@param objects The objects to populate in the select
A helper function that populates a select field . @param select_id The id of the select element to populate @param objects The objects to populate in the select
function populateSelect(select_id, objects) {
    const select = document.getElementById(select_id);
    select.innerHTML = "";
    const choose = document.createElement("option");
    choose.value = "";
    choose.text = "Choose...";
    select.add(choose);
    objects.forEach(object => {
        select.add(object.toSelectOption());
    });
}
function populateSelect ( select_id , objects ) { const select = document . getElementById ( select_id ) ; select . innerHTML = "" ; const choose = document . createElement ( "option" ) ; choose . value = "" ; choose . text = "Choose..." ; select . add ( choose ) ; objects . forEach ( object => { select . add ( object . toSelectOption ( ) ) ; } ) ; }
A helper function that populates a select field.
A helper function that populates a select field .