views:

43

answers:

3

hi, I have created web application and textbox as a textarea.i am using javascript for validation.When i enter value in text box so it should be number not alphabet i have use textmode is multiple line.

My problem is that how i get multiple value from textbox and store in array in javascript and check each value is number or not.I am using the web form.Please help me.

+1  A: 
rahul
A: 

As addition to rahul:

If you want the values in the textarea seperated by line, you can use \r\n as the splitter.

MrSoundless
A: 

This is a starter for ten.

var textValues = document.getElementById("mytextarea").value.split("\n");
for (var i = 0; i < textValues.length; i++) {
    if (isNaN(textValues[i])) {
        alert(textValues[i] + " is not a number.";
    }
}
Sohnee
Thank you Its working.
jiya gupta