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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:16:35+00:00 2026-06-14T18:16:35+00:00

I have a form that gets generated dynamic every time with PHP and also

  • 0

I have a form that gets generated dynamic every time with PHP and also gets updated with jQuery .appendTo() while the visitor interacts with it. The problem I have is that I want to get every single value of input text and select boxes from the current form and submit them with POST in arrays.
So far I have done the following (an example):

   <div>
        <input type="text" class="dynamicTags" name="dynamicTags1" value="Web Design"/>
        <select class="val_tag" name="val_tag1">                                               
               <option value="1" >Newbie</option>
               <option value="2" >Amateur</option>
               <option value="3" selected="selected" >Rockstar</option>
        </select>
    </div>                            
    <div>
        <input type="text" class="dynamicTags" name="dynamicTags2" value="Programming"/>
        <select class="val_tag" name="val_tag2">                                               
               <option value="1" >Newbie</option>
               <option value="2" selected="selected" >Amateur</option>
               <option value="3" >Rockstar</option>
        </select>
    </div>
    <div>
        <input type="text" class="dynamicTags" name="dynamicTags6" value="Java"/>
        <select class="val_tag" name="val_tag6">                                               
               <option value="1" >Newbie</option>
               <option value="2" >Amateur</option>
               <option value="3" selected="selected" >Rockstar</option>
        </select>
    </div>
    <div>
        <input type="text" class="dynamicTags" name="dynamicTags13" value="Photoshop"/>
        <select class="val_tag" name="val_tag13">                                               
               <option value="1" >Newbie</option>
               <option value="2" selected="selected" >Amateur</option>
               <option value="3" >Rockstar</option>
        </select>
    </div>

The name of each input text and select box is generated dynamic. The classes are the same.
With jQuery I managed to pass to my script simple variables from textboxes and select boxes (that I know from before) but I can’t get to make it work with arrays. I have tried

data: {valTags: $('.val_tag').val(), dynTags: $('.dynamicTags').val()}

inside the $.ajax() function but without any luck. Sure I’m missing something crucial here but I can’t find the proper way to do it. Do I have to use .each() function somehow?

In the end I would like to have in my $_POST variable two arrays like that:

dynamicTags[] = ([0] => 'Web Design', [1] => 'Programming', [2] => 'Java' ...etc....)

val_tag[] = ([0] => 1, [1] => 0, [2] => 0 ...etc....)
  • 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-14T18:16:37+00:00Added an answer on June 14, 2026 at 6:16 pm

    Have you tried your data as

     Data: serialize( $('#formID') ),
    

    It would send all your form values in the post array which php can json_decode and iterate through as needed

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

Sidebar

Related Questions

So I have a form that gets dynamically generated by a script to have
I have created a list form that gets attached to a main form in
I have a method, -(void)validateFormInput:(UITextField *)textField that gets called when the form's submit button
I have a form that i want to appear at the top of every
I have an auto-generated file each day that gets called by a shell script.
I'm using the CodeIgniter PHP framework. I have a simple form that has an
I have two tables that I've styled the same. I've added a form (generated
I have a form that has been getting slower as time goes on. At
I currently have form that checks if a user has unsubmitted changes when they
I have a form that I'm submitting through AJAX. The form includes many fields,

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.