• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How do I get the value of a text area?

New Here ,
Oct 23, 2017 Oct 23, 2017

Copy link to clipboard

Copied

I am a novice when it comes to CF.  Our company uses CF16.   I am copying existing code from one our other websites, however nobody is around that worked on it so there is nobody to ask.

The code displays a hidden <td> holder called "help_field_1new".  This is used for entering new help information.  When a button is pressed to add a new record the program updates the innerHTML to a textarea field  (code = (document.getElementById(help_field_1new).innerHTML = "<textarea name='help_field_1_textnew cols='70' rows='3' onKeyUp='validateLen(event,this,2000);' onPaste='return validateLen(event,this,2000); return validEntry(event);' onDrop='return validateLen(event,this,2000); return validEntry(event);'>"+document.getElementById(help_field_1new).innerHTML+"</textarea>")

The problem is that I can't figure out how to retrieve the actual value that is entered....

I've tried document.getElementById, but all I get is the actual HTML.

Advice?

Thanks.

Views

833

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 23, 2017 Oct 23, 2017

Copy link to clipboard

Copied

You would be better off asking this over at Stack Overflow - Where Developers Learn, Share, & Build Careers  as its a Javascript question rather then Coldfusion.

If you are looking to get the content of the <td> then you can use '.text' function

Otherwise its a bit hard to see what you are trying to achieve without all the code and formatting etc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2017 Oct 24, 2017

Copy link to clipboard

Copied

LATEST

First of all, the code you've given contains an error. There should be an extra single quote to delimit the name. That is, name='help_field_1_textnew' cols='70' in place of name='help_field_1_textnew cols='70'. It might be possible to get the value of the teaxtarea, in the action page, as form.help_field_1_textnew.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation