[JavaScript] Get value from a textarea

Solved
FranckyFourFinger -  
 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. jeangilles Posted messages 816 Registration date   Status Member Last intervention   186
     
    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
  2. FranckyFourFinger
     
    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