title: Using javascript function inside html form being echoed inside php
body: <p>Forgive the title, this is the best way I can think to word my issue.</p>
  
  <p>Basically, I have a html form inside some php code, but I need to include javascript functions (with parameters specified) inside the form. But I have an issue with the single and double quote marks escping the php code. See below:</p>
  
  <pre><code>echo'&lt;form id="create_booking_form" onsubmit="return false;"&gt;
                      &lt;div&gt;Student Name: &lt;/div&gt;
                      &lt;input id="students_name" type="text" onfocus="emptyElement('status')" onkeyup="restrict('students_name')" maxlength="30"&gt;
                      &lt;div&gt;Parents Name: &lt;/div&gt;
                      &lt;input id="parents_name" type="text" onfocus="emptyElement('status')" onkeyup="restrict('parents_name')" maxlength="30"&gt;
                      &lt;div&gt;Parents Email Address: &lt;/div&gt;
                      &lt;input id="parents_email" type="text" onfocus="emptyElement('status')" onkeyup="restrict('parents_email')" maxlength="100"&gt;
                      &lt;div&gt;Booking Time: &lt;/div&gt;
                      &lt;input id="booking_time" type="text" onfocus="emptyElement('status')" onkeyup="restrict('booking_time')" maxlength="8"&gt;
                      &lt;div&gt;Comments / Questions: (max 255 characters)&lt;/div&gt;
                      &lt;input id="comments" type="text" onfocus="emptyElement('status')" onkeyup="restrict('comments')" maxlength="255"&gt;
                      &lt;div&gt;Password: &lt;/div&gt;
                      &lt;input id="password" type="password" maxlength="16"&gt;
                      &lt;br /&gt;&lt;br /&gt;
                      &lt;button id="createbookingbtn" onclick="createbooking()"&gt;Submit your booking&lt;/button&gt;
                      &lt;span id="status"&gt;&lt;/span&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;';?&gt;
  </code></pre>
  
  <p>My issue is for example: onkeyup="restrict('students_name')"</p>
  
  <p>If i use single quote to specify 'student_name' it escapes the echo command form the php code. If i use double quotes it escapes the restrict() function...</p>
  
  <p>What can I do?</p>
  
  <p>Much appreciated</p>
  
  <p>Is anyone able to help me out here?</p>