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

  • Home
  • SEARCH
  • 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 967715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:21:48+00:00 2026-05-16T02:21:48+00:00

function confirm_results(theform) { var inputsX = document.getElementById(theform).getElementsByTagName(‘textarea’); for(var iX = 0, nX = inputsX.length

  • 0
function confirm_results(theform) {

var inputsX = document.getElementById(theform).getElementsByTagName('textarea');
          for(var iX = 0, nX = inputsX.length - 1; iX < nX; iX++)
          {
            text += inputs[iX].innerHTML + ', ';
          }
return text;
}

Can anyone tell me why this isn’t working? I’m trying to find all of the textarea’s inside a DIV that I pass the name through, and return the text. Some reason it just doesn’t do anything.

  • 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-16T02:21:49+00:00Added an answer on May 16, 2026 at 2:21 am

    innerHTML is not the right way to read a textarea’s value.

    Partly because any < or & characters in it will be HTML-escaped, but mostly because the text node content inside an HTMLTextAreaElement node is not indicative of the current value of the textarea.

    In fact the text node content is the original content of the textarea as seen in the HTML source. This is the same as the defaultValue property. It does not get updated when you type in the textarea… except in IE which as usual gets it all wrong.

    You probably want to use inputs[iX].value instead.

    The same goes for normal inputs, where input.value represents the current value but input.getAttribute('value') is the same as input.defaultValue, representing the original value put in the value="..." attribute in the HTML source. Again: except in IE due to more bugs.

    The same again applies to the checked and selected properties of checkboxes and select options: the checked and selected attributes are the original values reflected in the defaultChecked and defaultSelected properties.

    Also, with the length-1 you’re ignoring the last textarea in the list. Do you really mean to do that?

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

Sidebar

Related Questions

My JSON object is constructed like this: var Source = { Object: [ //Array
Having some issue with my function call please. I have a situation that I
To the point, I want to override the standard js confirm() function within a
Code: $.ajax({ type: POST, url: students/login, data:{data[Student][email]:_email,data[Student][password]:_password},ss beforeSend: function(){ $(#confirm).text(); }, error: function (xhr,
I'm trying to streamline my login system by using ajax to handle to back
Ok, here is a real short query. I am calling __FILE__ from inside a
Our core server is calling out to a soap web service over https on
Summary Using Windows GDI to convert 24-bit color to indexed color, it seems GDI
I'm trying to read a URL within our corporate network. Spesifically the server I'm
I have the following link which opens a jquery modal window: <div id='confirm-dialog'><a href='#'

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.