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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:32:07+00:00 2026-05-23T12:32:07+00:00

I have a form like this: <form id=cform> <label>folder name:</label> <input type=text name=Folder[name] />

  • 0

I have a form like this:

 <form id="cform">
    <label>folder name:</label>
    <input type="text" name="Folder[name]" />
    <input id="cfolder" type="submit" value="create" />
 </form>

I want to submit the form in jQuery ajax, so I have code like this:

 $.ajax({
    type: "POST",
    url: "/folder/create",
    data: $('#cform').serialize(),
    success: function(msg){
        //sucess
    }
  });

this is all easy so far, but now I want to submit an extra dynamic id($id value is available) along with the whole form. how Can I do that? I tried this:

 data: $('#cform').serialize()+"&Folder[id]="+$id,

but it didn’t work, the server side did not get the id. the tricky part here for me is Folder[name], Folder[id],
because the server side recevie the data in php like this:

if(isset($_POST['Folder'])){
    //assign data here
}

hope this is clear and thanks for any suggestion.

  • 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-23T12:32:07+00:00Added an answer on May 23, 2026 at 12:32 pm

    As an alternative suggestion:

    You can use .serializeArray [docs] and $.param [docs]. Then jQuery will take care of all the encoding:

    var data = $('#cform').serializeArray();
    data.push({name: "Folder[id]", value: $id});
    
    // later
    
    data: $.param(data);
    

    I don’t understand if you have a problem with $_POST['Folder'] or not, but if you use names with brackets at the end, PHP will parse the data into an array.

    Thus you can access the data with $_POST['Folder']['name'] and $_POST['Folder']['id'].

    For more information have a look at Variables From External Sources.

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

Sidebar

Related Questions

I have a form like this: <form name=mine> <input type=text name=one> <input type=text name=two>
I have a form like this: one.php <form id='myFormId' name='myFormName'> <input type='text' name='myTextField'> <a
I have a form like this: <form id='myForm'> <input type='text' name='search' /> <input type='text'
I have a form like this: <form id='formid'> <input type='text' name='textname'> <input type='button' id='resetbutton'>
I have a form like this: <form id=form_main name=form_main action=/search/ target=iframe001 method=get onSubmit=reset_and_subm();> Enter
I have a bunch of rows in a form like this <tr> <td nowrap><input
I have a datefield in a form like this: { xtype:'datefield', name:'order[date]', id:'dato', format:'d-m-Y',
I have 2 tables which in simplified form look like this: Products( id: int,
In my views.py, i have a snippit of code like this: def clean_post_data(form): for
I have a simple form with some plain html input like bellow using ASP.NET

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.