Is this a correct way to call a javascript function?
<p>Is this the correct way to call my javascript function with jquery? I have spent the last 5 hours trying to figure out why this won't work.</p>

<pre><code>&lt;form class="rpt" id="rpt" action=""&gt;
</code></pre>

<p><hr /></p>

<pre><code>$(function() {
  $("#rpt").submit(doSave);
});
&lt;/script&gt;
</code></pre>

<p><hr /></p>

<p>Here is the small snippet of code in the javascript wysiwyg editor. I'm still using the exact same form tag in my html.</p>

<pre><code>  // Save
  case "Save":
      WYSIWYG.updateTextArea(n);
      var form = WYSIWYG_Core.findParentNode("FORM", this.getEditor(n));
      if(form == null) {
       alert("Can not submit the content, because no form element found.");
       return;
      }
      form.submit();
  break;
</code></pre>
