title: How do I embed Javascript in PHP code?
body: <p>I have a HTML form and PHP code. In my form, I have a textbox and a textarea. Within both, I have included the "disabled" option. I want both textboxes to remain disabled until the user decides to click the "Edit" button, in which case both textboxes should be enabled so changes can be made and the output once again saved. According to the research I have done, the only way to do this is to use javascript, so I have included the following code within my PHP;</p>
  
  <pre><code>if (isset($_POST['edit']))
  {
      echo "&lt;script type=\"text/javascript\"&gt;";
      echo "var oldnotes = document.getElementById('oldnotes');";
      echo "oldnotes.disabled = false;";
      echo "var record = document.getElementById('record');";
      echo "record.disabled = false;";
      echo "&lt;/script&gt;";
  }
  </code></pre>
  
  <p>I have also tried;</p>
  
  <pre><code>if (isset($_POST['edit']))
  {
      echo "&lt;script type=\"text/javascript\"&gt;";
      echo "$('#oldnotes').removeAttr('disabled')";
      echo "$('#record').removeAttr('disabled')";
      echo "&lt;/script&gt;";
  }
  </code></pre>
  
  <p>But no luck :(</p>
  
  <p>I am not receiving any errors, the textboxes just remain disabled after I click the Edit button. Could anyone help me with this? Thanks in advance. </p>