title: Can't call javascript functions
body: <p>The page source:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Admin Search Results&lt;/title&gt;
  
  &lt;script type="text/javascript"&gt;
  function delete()
  {     
      alert("abc");
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Admin Search Results&lt;/h1&gt;
  &lt;form id="modDel" action="modDel.pl" method="post" onsubmit="return delete()"&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;
  &lt;th&gt;User Name&lt;/th&gt;
  &lt;th&gt;Email&lt;/th&gt;
  &lt;th&gt;First Name&lt;/th&gt;
  &lt;th&gt;Last Name&lt;/th&gt;
  &lt;th&gt;Password&lt;/th&gt;
  &lt;th&gt;Blocked&lt;/th&gt;
  &lt;th&gt;Modify&lt;/th&gt;
  &lt;th&gt;Delete&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;input type="hidden" id="un_0" name="un_0" value="aa"&gt;
  &lt;td&gt;aa&lt;/td&gt;
  &lt;td&gt;aa&lt;/td&gt;
  &lt;td&gt;aa&lt;/td&gt;
  &lt;td&gt;aa&lt;/td&gt;
  &lt;td&gt;aa&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="modify_0" value="Modify"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" id="delete_0" name="delete_0" value="Yes"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;input type="hidden" id="un_1" name="un_1" value="a"&gt;
  &lt;td&gt;a&lt;/td&gt;
  &lt;td&gt;a&lt;/td&gt;
  &lt;td&gt;a&lt;/td&gt;
  &lt;td&gt;a&lt;/td&gt;
  &lt;td&gt;a&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="modify_1" value="Modify"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" id="delete_1" name="delete_1" value="Yes"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/table&gt;
  &lt;input type="hidden" id="count" name="count" value="1"&gt;
  &lt;input type="submit" id="delete" name="delete" value="Delete Selected Accounts" onclick="delete()"&gt;
  &lt;button type="button" onclick="delete()"&gt;Display Date&lt;/button&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It's generated by a perl script from two templates (one for the table).</p>
  
  <p>All i want is to get something to happen on some event. I've added onsubmit and onclick but neither work.</p>
  
  <p>I'm sure i'm just missing something small but i can't see it.
  i'm using chrome, btw.</p>
  
  <p>Edit: i can get it to work by adding the js code directly into the onclick/onsubmit quotes.</p>