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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:01:46+00:00 2026-05-27T21:01:46+00:00

I’m building a web form that populates dynamically from a stored procedure. It is

  • 0

I’m building a web form that populates dynamically from a stored procedure. It is a table with a dropdown list and a text box and one label. I can successfully grab the data from the dropdown and the text box, but I cannot grab the data from the label. Here is the code that populates the data section of the table.

        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'><select name='select_" + count + "'><option value='Pending'>Pending</option><option value='Approve'>Approve</option><option value='Deny'>Deny</option></select></td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'><input type='text' name='comments_" + count + "' /></td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + locationNum + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + shipToNum + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + address + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + city + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + state + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + zip + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + soldToName + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + exemptionDescription + "</td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'><label for='select_" + count + "' name='label_" + count + "'>" + exemptionRequestDetailID + "<label></td>");
        sb.Append("<td style='border-top: 1px solid black; border-left: 1px solid black;'>" + reason + "</td>");

Here is the code that grabs the needed data from the table in the aspx page and sends it to the codebehind for manipulation.

function SendForm() {
        var count = 0;
        var elLength = form1.elements.length;
        for (i = 0; i < elLength; i++) {
            var type = form1.elements[i].type;
            alert(type);
            if ((type == "select-one") && (form1.elements[i].value != "Pending")) {
                count++
            }
        }
        var data = new Array(count);
        var text = new Array(count);
        var exempID = new Array(count);
        for (i = 0; i < elLength; i++) {
            var type = form1.elements[i].type;
            if ((type == "select-one") && (form1.elements[i].value != "Pending")) {
                data[i] = form1.elements[i].value;
            }
            if ((type == "text") && ((form1.elements[i-1].value == "Approve") || (form1.elements[i-1].value == "Deny"))) {
                text[i] = form1.elements[i].value;
            }
            if ((type == "label") && ((form1.elements[i-2].value == "Approve") || (form1.elements[i-2].value == "Deny"))) {
                alert(form1.elements[i].value);
            }


        }


        PageMethods.SendForm(data, text, OnSucceeded, OnFailed);
    }

I have alerts set up to check if it is grabbing the label values, but it is showing nothing at all for the label. Any help would be appreciated.

  • 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-27T21:01:47+00:00Added an answer on May 27, 2026 at 9:01 pm

    If I read this correctly, you’re looking for the inner text (below, locationNum), rather than the label, of an element like this:

    <td style='border-top: 1px solid black; border-left: 1px solid black;'>" + locationNum + "</td>
    

    If that’s the case, take a look at firstChild.nodeValue of the td element.

    var table_children = document.getElementsByTagName( 'td' );
    var x = 0, len = table_children.length;
    for( x = 0; x < len; x += 1 ) {
         var tag_text = table_children[ x ].firstChild.nodeValue;   
         alert( tag_text );
    }
    

    No jQuery required. Interact with this code here.

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

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I have a bunch of posts stored in text files formatted in yaml/textile (from
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.