title: Disable submit button if checkbox is not checked in flask/html/python
body: <p>I am making a quiz sort function with <strong>python</strong>, <strong>html</strong> and <strong>flask</strong>. I need to make sure that an answer with the radio buttons is selected before letting the user click the submit function.</p>
  
  <p>This is the python code for the function and html for button:</p>
  
  <pre><code>     def EnableSubmit():
  
          sbmt = document.getElementById('submit-button')
          if val.checked == True:
             sbmt.disabled = False
          else:
             sbmt.disabled = True
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div&gt;
         {% for elem in song_options %}
              &lt;input type="radio" name="song" value = "{{elem}}"&gt; {{elem}} &lt;br&gt;
         {% endfor %}
  &lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;
  
    &lt;input type="submit" value="Submit" id="submit-button" onClick="EnableSubmit(this)"&gt;
    &lt;input type = "hidden" name = "songandartist" value = "{{song_name , song_artist}}"&gt;
  </code></pre>