How to disable a submit button until a radio button is selected (Javascript, HTML, and Flask)

Solution
// Get your DOM references just once, not every time
// the function is called.
let update = document.querySelector('#update_button');

// Use "event delegation" and set up the event at
// a common ancestor element of the elements you
// wish to handle.
document.querySelector('form').addEventListener('click', enable);

function enable(event) {
  // Check to see if it was a radio button that 
  // initiated the event
  if(event.target.name === "material_update"){
    // False in JavaScript is false, not False
        update.disabled = false;
  }
}

Update Appointment:



Current material = {{ appt.material }}