[JavaScript] Get value from a textarea

Solved
FranckyFourFinger -  
Hello,

I'm writing a form validation script and I would like to know how to retrieve the value of a textarea to check if it is filled in or not.

Thank you in advance.

2 answers

  1. you give an id to your textarea in your html, and you do

    var t = document.getElementById('iddutextarea').value;

    your variable t will have the value of your textarea
    14
    1. Well thank you very much, Jeangilles, there are times when you don't feel very bright... I don't know why I didn't think of it.
      2