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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:28:57+00:00 2026-05-23T13:28:57+00:00

I have a HTML form where i dynamically create elements and set its name

  • 0

I have a HTML form where i dynamically create elements and set its name , value attributes .

when i tried to access the value say document .formname.nameoftheelement.value then i get the error that value is undefined.

Then i tried to use the following function to access the values .it returns the input elements as 4 but value as null when i it already has predefined value .

function returnTheStoredValues(getTableName) {
    //Array arrList = new Array(20);
    var tableName = document.getElementById (getTableName);
    console.log("The table name" + tableName);
      if (tableName) {
          var inputs = tableName.getElementsByTagName ('td');
          console.log("the inputs are " + inputs.length);
          if (inputs) {
              console.log("inputs not equal to null")
              for (var i = 0; i < inputs.length; ++i) {

                    console.log("the value in phones table are " + inputs[i].value);
                    //arrList[i] = inputs[i].value;

              }
          }
      }
      //return arrList;
} 

The html code is

Phone

         <table id="email_table">
         <tr>
         <td><h3>Email</h3></td>
         <td><input value="+" type="submit" onClick="checkTheEmailButtonClicked()"></td>
         </tr>
         </table>
        <table>
             <tbody>
                 <tr>
                     <td><input type="submit" value ="Save" onclick="getData();"/></td>
                     <td><input type="submit" value = "Cancel"/></td>
                  </tr>
            </tbody>
        </table>    

Appreciate all your help .

  • 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-23T13:28:57+00:00Added an answer on May 23, 2026 at 1:28 pm

    You seem to want the values of the input elements, so:

    function returnTheStoredValues(getTableName) {
        var arrList = [];
        var table = document.getElementById(getTableName);
        var inputs = table.getElementsByTagName('input');
    
        for (var i=0, iLen=inputs.length; i<iLen; i++) {
          arrList[i] = inputs[i].value;
        }
        return arrList;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I want to create a form that allows you to add elements dynamically
I have an html form. I need to send its data to flash on
I have select inputs dynamically added to form by $(selector).append(html) I'm using live('change',handler) to
Let's say I have some HTML and Javascript which adds text fields dynamically to
To dynamically fill DropDown controls on my HTML Form, I have written code that
I have custom Question objects which I render into html form elements. I want
I have the following dynamically created HTML block: <form class=standard settingsPage method=post enctype=multipart/form-data name=account
I have an HTML form, to which I dynamically add a text field and
Essentially, I have a dynamically generated local HTML form that I would like to
I have an HTML form - with PHP, I am sending the data of

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.