Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 803325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:44:31+00:00 2026-05-14T23:44:31+00:00

I have a table with a bunch of buttons like so: <tr class=hr-table-cell >

  • 0

I have a table with a bunch of buttons like so:

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

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

I have my jquery like so:

  <script type="text/javascript"> // 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();

  }

});

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:

  <script type="text/javascript">

  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();

  }

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?

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?

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.

Cheers.
K

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:44:31+00:00Added an answer on May 14, 2026 at 11:44 pm

    By declaring the function outside of ready, you are declaring it at a global scope, so it is accessible by the DOM declaration.

    Otherwise, if you declare it inside ready, you are declaring a function that is “private” to the scope of ready – nothing outside of this function can see the declaration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table containing a bunch of input fields, sort of like a
i have a table which contains a bunch of dynamically created radio button lists,
I have a table that lists a bunch of customers. The last cell is
I have a series of table rows like this: <cfloop query=qryPlayer> (...snip...) <input data-playerid=#PlayerID#
I have a table and in a cell I have something like this .
I have a table schema which is essentially a bunch of transaction info with
so I have this HTML table with a bunch of big numbers in it
I have a bunch of coordinates in my table grid with the following schema
I have to copy a bunch of data from one database table into another.
I have a bunch of tables that are like Client# and the # changes.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.