Im unable to store any values from the textarea input. When ever I run the
for loop to retrieve the values from the array, it is displayed as
undefined. I not sure how to solve that problem. Any help would be
appreciated.

--------------------------------------------------------------------------------------------
$(document).ready(function(){
   var choices = new Array();
   var prev = 0;
   var nex;
   for(i = 0;i < 10;i++) {
      $('#textarea1').bind('keypress', function(e) {
           if(e.keyCode==13){
                nex = $('#textarea1').val().length;
                choices[i] = $('#textarea1').val().substring(prev,nex);
                prev = nex;

           }
      });
   }

for(i = 0;i< choices.length;i++){
      $("#div1").append("<p> " + choices[i] + "</p>");
   }

});
--------------------------------------------------------------------------------------------

-- 
View this message in context: 
http://old.nabble.com/Help-needed-with-textarea.-tp26991838s27240p26991838.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to