0

I am working on some form when i refresh the page the value which is present there is going blank if i do a right click and doing an inspect element the value is present there which is like this.

<textarea class="inputbox" tabindex="23" rows="5" name="keySkills" id="keySkills" style="width: 400px;" value="Configuration  of  controlling  area  (CO),  Maintaining  CO   version   and
Maintaining number ranges for planning and actual  transactions  in  CO  and
Defining primary and secondary Cost Element"></textarea>

But in console of google if i am running this code which is returning blank.

var value = document.getElementById('keySkills');
console.log(variable.value)

It is showing me undefined. but if i do

console.log(variable)

It is prinitng this

<textarea class="inputbox" tabindex="23" rows="5" name="keySkills" id="keySkills" style="width: 400px;" value="Configuration  of  controlling  area  (CO),  Maintaining  CO   version   and
Maintaining number ranges for planning and actual  transactions  in  CO  and
Defining primary and secondary Cost Element"></textarea>

Any idea how to fix this i want the value to remin in the text area itself

Arun VM
  • 447
  • 1
  • 6
  • 17

1 Answers1

0

In order to post the content of a textarea element to your backend you shouldn't rely on the value attribute. That's fine for many other elements, but a textarea contains the value between the opening and closing tags, like this...

<textarea>This is your text value</text>

That text will be available in whatever server application is handling your form submission.

Reinstate Monica Cellio
  • 25,975
  • 6
  • 51
  • 67