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

The Archive Base Latest Questions

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

I want to implement dynamic select box. I have do it success fully, but

  • 0

I want to implement dynamic select box. I have do it success fully, but when my page is submitted I the value is not there
See my code below

<select name="frm_child" id="frm_child" style="width:50px;" onchange="addFLd(this.value)" >
         <option value="0" >0</option>
            <option value="1" >1</option>
            <option value="2" >2</option>
            <option value="3" >3</option>
            <option value="4" >4</option>
            <option value="5" >5</option>
            <option value="6" >6</option>
        </select

Dynamic field display in childDynamic div. Which is inside the form tag? But when I submit my form, I can’t see the result from select box. See my js code below

<div id="childDynamic" style="display:none;">
      <input type="text" name="child1" value="" />
      </div>

My JavaScript code id

<script type="text/JavaScript">
Function addFLd(val){
var d=document.getElementById("childDynamic");
d.style.display='block';
d.innerHTML="";
    if(val!=0){

            d.innerHTML="<b>Please specify the ages of children:</b><br><br>";
            for(var i=1;i<=val;i++){
            if(i%2!=0 && i!=1){
            d.innerHTML+="<br><br>";
            }
            var name='child'+i;
            d.innerHTML+="&nbsp;&nbsp;Child "+i+": ";
            d.innerHTML+="&nbsp;<select name='"+name+"' id='"+name+"'><option value=''>--select--</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option><option value='13'>13</option><option value='14'>14</option><option value='15'>15</option><option value='16'>16</option><option value='17'>17</option>";

            d.innerHTML+="</select>";
            }
            d.innerHTML+="<br><br>";
             document.getElementById('childDynamic').appendChild(d);

                }
}
</script>

Does anyone know how I add dynamic fields and get the values in action with the form elements?

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

    Perhaps a better alternative is to include the form inputs in the original markup and rather than appending them if necessary, simply enable them by removing the disabled="disabled" attribute and also removing display:none style to reveal them on the page.

    I would think you’d get more luck with cross browser support, as some don’t submit dynamically added form elements.

    Alternatively, I recommend using a javascript framework to do the appending, such as jQuery.

    See this link for details on how you might append form elements to a page:

    http://api.jquery.com/append/

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

Sidebar

Related Questions

I have a dynamic web page and want to implement dynamic guestbook into DIV
I want to implement dynamic, client side file generation in javascript. Is it possible?
i want to implement a dynamic relation mechanism with python something like: a:=10 b:=30
I want implement in my software solution an VBA editor but in c# 3.0.
I want to implement my own dynamic memory management system in order to add
i have simple JAXWS client with dynamic url. i want to add timeout .
Iam using Drupal 6. I want to implement Captcha in static pages. I have
I have a question on how to implement a dynamic text area with link
I have a very dynamic (social networking) site running smarty that I want to
I want self-education purpose implement a simple virtual machine for a dynamic language, prefer

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.