jquery function call with parameters
<p>I have a table with a bunch of buttons like so:</p>

<pre><code>&lt;tr class="hr-table-cell" &gt;
    &lt;td&gt;REcord 1&lt;/td&gt;
    &lt;td&gt;
        &lt;INPUT type="button" value="Approve"  onclick="" /&gt;
        &lt;INPUT type="button" value="Reject"  onclick="" /&gt;
        &lt;INPUT type="button" value="Delete"  onclick="fnDeletePpAppl(222445,704);" /&gt;
    &lt;/td&gt;
  &lt;/tr&gt;

  &lt;tr class="hr-table-cell" &gt;
    &lt;td&gt;REcord 1&lt;/td&gt;
    &lt;td align="center" class="hr-table-bottom-blue-border" valign="middle"&gt;
        &lt;INPUT type="button" value="Approve"  onclick="" /&gt;
        &lt;INPUT type="button" value="Reject"  onclick="" /&gt;
        &lt;INPUT type="button" value="Delete"  onclick="fnDeletePpAppl(237760,776);" /&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
</code></pre>

<p>I have my jquery like so:</p>

<pre><code>  &lt;script type="text/javascript"&gt; // JQUERY stuff
    $(document).ready(function(){

  function fnDeletePpAppl(empno, applno) {
    alert('Entering here');
    $("form").get(0).empno.value = empno;
    $("form").get(0).applNo.value = applno;
    $("form").get(0).listPageAction.value = "delete"; 
    $("form").get(0).action.value = "pprelreqlist.do";
    $("form").get(0).submit();

  }

});
</code></pre>

<p></p>

<p>This doesn't seem to work.I thought this means, the function is ready only after the dom is ready. After the dom is ready and i click the button, why is not recognizing the function declaration within the .ready() function? However if i use the function directly:</p>

<pre><code>  &lt;script type="text/javascript"&gt;

  function fnDeletePpAppl(empno, applno) {
    alert('Entering here');
    $("form").get(0).empno.value = empno;
    $("form").get(0).applNo.value = applno;
    $("form").get(0).listPageAction.value = "delete"; 
    $("form").get(0).action.value = "pprelreqlist.do";
    $("form").get(0).submit();

  }
</code></pre>

<p></p>

<p>This works. I want to get my fundamentals straight here... If i do the declaration without the .ready() , does that mean i'm using plain vanilla jscript?</p>

<p>If i were to do this with the document.ready - the usual jquery declaration way, what would i have to change to make it work?</p>

<p>I understand there are much better ways to do this like binding with buttons etc, but I want to know why this particular way doesn't seem to be working. Thanks.</p>

<p>Cheers.
K </p>
