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

  • SEARCH
  • Home
  • 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 8324027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:54:30+00:00 2026-06-08T23:54:30+00:00

Okay .. this is my attempt to execute a function instead of calling from

  • 0

Okay .. this is my attempt to execute a function instead of calling from it from the tag .. thing is .. it’s not working .. mind you I’m still fresh with all these sigh

        <div class="widget first">
                <div class="head"><h5 class="iFrames">Static table</h5></div>
            <table id="example" cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
                <thead>
                        <tr>
                        <td width="20%">Column 1</td>
                        <td width="20%">Column 2</td>
                        <td width="20%">Column 3</td>
                        <td width="20%">Column 4</td>
                        <td width="20%">Column 5</td>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>

<input type="text" name="name" id="name" />

and the script would go:

/* Global var for counter */
var giCount = 1;

$(document).ready(function() {
   $('#example').dataTable();
} );

function fnClickAddRow() {
    $('#example').dataTable().fnAddData( [
        $("#name").val(),
        giCount+".2",
        giCount+".3",
        giCount+".4",
        giCount+".5" ] );
     $("#name").val('').focus();
    giCount++;
}

$('#name').on('keyup', function(e) {
    var code = (e.keyCode ? e.keyCode : e.which);
    if (code == 13) {
       fnClickAddRow();
    }
});

Now, I’m trying to add new row with the value of “name” from the input upon entering. And it’s not working :\ .. by the way in this example I’m using DataTables …

  • 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-06-08T23:54:31+00:00Added an answer on June 8, 2026 at 11:54 pm

    It works for me:

    http://jsfiddle.net/eCrJc/1/

    Try to put fnClickAddRow() and $('#name').on('keyup' inside $(document).ready and check your browser’s console for any javascript errors.

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

Sidebar

Related Questions

Okay this is my 4th question today on Scheme, still pretty new to Scheme,
Okay this one may be a bit out from left field, but I'm going
Okay, sample code first; this is my attempt at communicating what it is that
Okay this is a revised question from earlier today, I have included code to
Okay this question is very simple: I have a facebook page, and a website.
Okay this is definitely a n00b question but here goes. The way I understand
Okay this is definitley an easy question and a stupid one but since I
Okay this may be a simple question but I have yet to come with
Okay this is werid, i keep getting the error, randomly. ValueError: matrix must be
Okay this is probably a really dumb question, however it's really starting to hurt.

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.