views:

37

answers:

2

How to check if certain row in textarea is empty?

+1  A: 
document.getElementById('textareaID').value.length === 0
XIII
On certain row ,for example on row 16.I.e to check if on this row have something written.
lam3r4370
Ok ,I have an idea.How to check if certain row in textarea is empty?
lam3r4370
A: 

I know what you're saying, but I've honestly never seen anything like it. You'd need to first be able to find all the rows in a textarea. With the textarea being an HTML element and the rows in it are not, I don't believe this can easily be done. You'd have to somehow append tags around each set of characters that are from start to end and then count those.

So basically you're looking at:

  • Count the number characters
  • Determine the absolute width of the textarea
  • check to see how many characters it takes to reach the full width of the textarea without wrapping to the next line.
  • Look through all of this and append tags around each set of row character blocks with a specific class and then do a count on those classes.

I'm not a JavaScript Guru and I have not written any books, but I've done a lot of JavaScript and jQuery work and from my experience, you would this to be a very troublesome project and may not even be possible to work the way you want it.

Sorry I couldn't help anymore.

What exactly are you trying to accomplish?

Michael Stone