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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:06:34+00:00 2026-05-12T14:06:34+00:00

I’ve tried searching around but there isn’t something that is a fairly concrete example

  • 0

I’ve tried searching around but there isn’t something that is a fairly concrete example of this, and my ‘jQuery-Foo’ Is rather poor.

Here’s what I’m trying to accomplish:

User is presented with a form in which they enter user data (first/last/address, etc).

When it comes time to add a phone number, they need to be able to add as many as they would like. Through jQuery, how would i add another textbox to the form at a specific div (say div id=”phoneNumbers”), and have those textbox values be added to the resulting formcollection object on save?

Would this sort of scenario even work? Can anyone suggest a better option for accomplishing this?

Thanks in Advance

  • 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-12T14:06:34+00:00Added an answer on May 12, 2026 at 2:06 pm

    Hasn’t anyone told you? You can do anything in jQuery 😉

    Here’s what the code might look like.

    $("#phoneNumbers").append(
          "<input type=\"textbox\" id=\"newTxtBox\" name=\"newTxtBox\" />");
    
    ...
    
    // Post the form with all values
    $.post("/target/action", $("#myform").serialize());
    

    Note that your div called “phoneNumbers” would have to be in the form “myform” for the new textbox value to be serialized and posted.

    This seems like a reasonable approach as long as you can be sure that all your users will have javascript enabled. However, it’s always suggested to have a “graceful degradation” backup approach for when javascript cannot be used. The way I usually implement this is by adding a button to the form, like “add another phone number”, that if clicked, would post back to the server and generate a new form with an additional text box. In my jQuery document.ready() function, I’d just hide the button.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't

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.