How to know the number of lines of text in iFrame
Posted on 2012-04-13
We are using iFrame in our web application to take the text data and provide the facility to format the data as per the user need. Typing, formatting the data and updating the to the data to database is working fine. When we are printing, we are getting the data from database and updating to text innerhtml. So the data is also printing fine. But when the data is too long and we need to start new page, I am expecting we need to know the number of ines in the content. So that as per the measure, I can print the data correctly in one page and move to the next page by leaving the required space for the header portion. This is the way we are taking the data in java script.
When we are taking the data
var testresult = window.frames["textEditor"].document.body.innerHTML;
After we retrive the data, we are upating to the control -
document.getElementById('OPLABTESTRESULTREPORT:TEMPLATE1').innerHTML = strTextResult;
I am thinking that if I can know the number of lines at the times of the text data to the database and I can save the value and follow that value count for better formatting in page level.
If any other way to find the numbers of lines from iFrame, that would be greatly appreciated.
Any response to my query,