title: JQuery - How to remove 'disable' from all form inputs on page load
body: <p>I am loading a page with all of the inputs &amp; selects in a form starting as disabled. I have scripts to "edit" that work perfectly when clicking a button, but I'm trying to do the same thing on the page load when the record is "new". Whether or not the WHY makes sense, here's the code: </p>
  
  <pre><code>&lt;?php  if($_GET['new'] == "yes"){  ?&gt;
  &lt;script&gt;
  $(document).ready(function(){
      $('#save').removeClass('hidden');
      $('#edit,#addnotes,#addtasks').addClass('hidden');
      var form = $(this).closest('form').find('input').prop('disabled', false);
      var form = $(this).closest('form').find('select').prop('disabled', false);
      form.children('input').removeAttr("disabled");
  });
  &lt;/script&gt;
  &lt;?php }  ?&gt;
  </code></pre>
  
  <p>The <code>$('#save').removeClass('hidden');</code> works just fine, as does the next line, but the form part is not working. Here is what DOES work when clicking the Edit button on my page: </p>
  
  <pre><code>$('#edit').on("click", function(e){
      e.preventDefault();
      var form = $(this).closest('fieldset').find('input').prop('disabled', false);
      var form = $(this).closest('fieldset').find('select').prop('disabled', false);
      form.children('input').removeAttr("disabled");
      $('#save,#cancel').removeClass('hidden');
      $('#edit,#addnotes,#addtasks').addClass('hidden');
  });
  </code></pre>