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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:30:49+00:00 2026-06-03T19:30:49+00:00

I have a form which is dynamically generated based on user input. Initially the

  • 0

I have a form which is dynamically generated based on user input.

Initially the user is shown 3 fields to select from (datefrom, dateto, and pitchtype), they select their options, click submit and the script generates a table with inputs for each date in the range for them to edit.

An example of the generated form is below:

<table id="avtable">

    <thead>
        <tr>
            <th>Date</th>
            <th>Current bookings</th>
            <th>Max bookings</th>
        </tr>
    </thead>

    <tbody>

        <form action="index.php?page=availability&amp;task=edit&amp;action=submit" method="post"></form>

            <input type="hidden" name="pitchtype" value="1" />

            <tr>
                <td>2012-05-13</td>
                <td>0</td>
                <td><input type="text" value="10" class="spinner" maxlength="3" name="max"></td>
            </tr>

            <tr>
                <td>2012-05-14</td>
                <td>0</td>
                <td><input type="text" value="10" class="spinner" maxlength="3" name="max"></td>
            </tr>

            <input type="submit" value="Save" name="Submit" />

        </form>

    </tbody>

</table>

In the recieving PHP file I need to be able to process the data for each date, and am clueless where to start! Typically if it was a static form I would just use something like

$max = $_REQUEST['max'];

To get the edited field.

Obviously what I need to do is pair up each edited field with its date, for me to then process the data as I normally would. I presume I would need some sort of php loop with the array of data from the form, but I’m not quite sure where to start… any ideas?

EDIT :

I presume I would need to edit my outputed form to something like this, so the name of each input was the same as the date column, so what I need to know is then how to get all dates in the receiving php file:

<table id="avtable">

    <thead>
        <tr>
            <th>Date</th>
            <th>Current bookings</th>
            <th>Max bookings</th>
        </tr>
    </thead>

    <tbody>

        <form action="index.php?page=availability&amp;task=edit&amp;action=submit" method="post"></form>

            <input type="hidden" name="pitchtype" value="1" />

            <tr>
                <td>2012-05-13</td>
                <td>0</td>
                <td><input type="text" value="10" class="spinner" maxlength="3" name="2012-05-13"></td>
            </tr>

            <tr>
                <td>2012-05-14</td>
                <td>0</td>
                <td><input type="text" value="10" class="spinner" maxlength="3" name="2012-05-14"></td>
            </tr>

            <input type="submit" value="Save" name="Submit" />

        </form>

    </tbody>

</table>

Many thanks!

Kevin

  • 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-03T19:30:52+00:00Added an answer on June 3, 2026 at 7:30 pm

    In order to pass information first you need to give the text input’s different names something like:

    <table id="avtable">
    
        <thead>
            <tr>
                <th>Date</th>
                <th>Current bookings</th>
                <th>Max bookings</th>
            </tr>
        </thead>
    
        <tbody>
    
            <form action="index.php?page=availability&amp;task=edit&amp;action=submit" method="post"></form>
    
                <tr>
                    <td>2012-05-13</td>
                    <td>0</td>
                    <td><input type="text" value="10" class="spinner" maxlength="3" name="SpinMax"></td>
                </tr>
    
                <tr>
                    <td>2012-05-14</td>
                    <td>0</td>
                    <td><input type="text" value="10" class="spinner" maxlength="3" name="SpinMax2"></td>
                </tr>
    
                <input type="submit" value="Save" name="Submit" />
    
            </form>
    
        </tbody>
    
    </table>
    

    From there, your PHP script should be something like this:

    $SpinMax = $_POST["SpinMax"];
    $SpinMax2 = $_POST["SpinMax2"];
    

    By using $_POST, you are able to assign the PHP variable based on the “name” you give it in the text area.

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

Sidebar

Related Questions

I have a form in struts 1.3 which is dynamically generated one and having
i have a form in which there can be multiple radio buttons generated dynamically
I have the following html form, which is generated dynamically: <ul class=precursorList> <li> Precursor
I have a form representing a survey that is dynamically generated based on some
In my C# Windows Forms form I have some buttons which are dynamically generated.
I have a page in which controls are dynamically generated as the user navigates
I have a form with multiple textboxes which are created dynamically, now all these
Brief: Based on a query, I have multiple checkboxes generated dynamically. The value of
I have a nested form in which I would like the form fields to
I have a form in WordPress that has a dynamically generated text box so

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.