This is what I've got:
Code: Select all
<?php
echo "<script>
window.sync = function(e) {
var fieldset = document.getElementById('lines');
var source = document.getElementById('some_text_area');
fieldset.scrollTop = source.scrollTop;
}
window.populate = function populate() {
if(populate.started){
return;
}
populate.started = true;
var fieldset = document.getElementById('lines');
var str = '';
for(var i=0;i < 100;i++){
str = str + (i +'\r\n');
}
fieldset.value = str;
}
</script>";
echo "<textarea style='40px;overflow:hidden;height:40px;' readonly='true' id='lines'>Hello</textarea>";
echo "<textarea style='width:500px;height:40px;' id='some_test_area' onclick='populate()' onscroll='sync();'><legend>hello</legend>Hello</textarea>";
echo "<cite>Hello</cite>";
?>