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 6921147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:14:18+00:00 2026-05-27T10:14:18+00:00

I am trying to add an type upon clicking the button. Here is my

  • 0

I am trying to add an type upon clicking the button.

Here is my jquery script:

$(function(){
  $("#add").click(function(){
  $("#inputboxes").append("<tr class='light'><td colspan='3' class='header'>Subject Name</td><td colspan='3'><input type='text' name='subject_name' /></td></tr>");
  })
});

Then my HTML markup:

<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table cellpadding="0" cellspacing="0" style="text-align:center;">
<thead>
    <tr>
        <th colspan="7">Add subject on the list of available subjects</th>
    </tr>
</thead>
    <tbody id="inputboxes">
        <tr class="dark">
            <td colspan="7">
                <input type="button" id="add" value="Click to add a subject" />
            </td>
        </tr>
    </tbody>
<tbody>
    <tr class="dark">
        <td colspan="7"><input type="submit" name="submit" value="Submit" /></td>
    </tr>
</tbody>
</table>
</form>

#on page top
if(isset($_GET['submit']) print_r($_GET); // the only entry of array is the [submit'] => "Submit"

I can successfully generate an box, however it seems that whenever I hit submit, the box doesn’t seem to be passed. Also how can I generate an increment in the name=”” of generated box.

For the record, I found the workaround for this, moved the form tag outside of the table. Thanks everyone.

  • 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-27T10:14:19+00:00Added an answer on May 27, 2026 at 10:14 am

    For the submit button to work, you need to put your inputs in a form. You can add an increment in the name if you want to, but it is not necessary. If you submit inputs with the same name, they will be submitted as an array.

    Adding increment:

    $(function(){
        var i = 1;
        $("#add").click(function(){
            $("#inputboxes").append("<tr class='light'><td colspan='3' class='header'>Subject Name</td><td colspan='3'><input type='text' name='subject_name" + (i++) + "' /></td></tr>");
        })
    });
    

    Adding form:

    <form action="url" method="POST">
        <table>
            <tbody id="inputboxes">
                <tr class="dark">
                    <td colspan="7"><input type="button" id="add" value="Click to add a subject" /></td>
                </tr>
            </tbody>
            <tbody>
                <tr class="dark">
                    <td colspan="7"><input type="submit" name="submit" value="Submit" /></td>
                </tr>
            </tbody>
        </table>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add a class to some input elements depending on the type,
I've made a c# class that I'm trying to run in PowerShell with add-Type.
I am trying to add a few extra methods to a matrix type from
I am trying to convert the following code into python: Columns(C:C).Select Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual
Been trying to add custom post type which was successful the problem i am
I'm trying to add a custom HTTP Validator as shown here . I want
I'm new to Flash Pro programming, and am trying to create a button-type symbol
I'm trying to add Monaco true type font on JEdit under Ubuntu Linux.
I'm trying add a tab to my web page that looks like this: Using
Trying to add an onclick handler to my tabs, and can't seem to get

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.