title: Using .val().length != 0 to show textbox
body: <p>I am working with a survey, with a note section after every question. Notes should only come up after pressing End or F10 the first time. After skipping ahead to question 2, and then going back to question 1, the note section for question 1 should again be hidden if there were no notes.</p>
  
  <p>However, if there is any writing in the notes section at all, I want them to remain visible after returning to question 1 from question 2.</p>
  
  <p>I am trying to accomplish this by using .val().length != 0 to display the notes if there is even one character written. I'm not sure if my issue here is with .val().length or with my preventDefault command, I want to prevent the default action which in this case is to not display the notes.</p>
  
  <pre><code>&lt;style&gt;
  #[% QuestionName() %]_div {display:none}
  &lt;/style&gt; 
  
  &lt;script&gt;
  
  $(document).keydown(checkNote);
  function checkNote(f){
  f = f || window.event;
  if (f.keyCode == '121' || f.keyCode == '35'){
      f.preventDefault(f);
      $("#[% QuestionName() %]_div").css('display', 'block');
      }
  }
  
  function displaynote(d){
      d = d || window.event;
      if  ($("#[% QuestionName() %]_div").val().length != 0) {
          d.preventDefault(d);
          $("#[% QuestionName() %]_div").css('display', 'block');  
          }
        }
  &lt;script&gt;
  </code></pre>
  
  <p>If somebody could tell me where my issue might be or provide an alternative to 
  .val().length != 0 if that's the problem, than that would be very helpful.</p>
  
  <p>Thanks!</p>