<script>
function focusit(){
var qbox = document.getElementById('q');
qbox.focus();
qbox.value = qbox.value;
}
</script>
<body onload="focusit();">
<textarea name='q' rows='3' cols='100' id='q'><?php sone code here ?></textarea>
this textarea is used to type in queries. when the page loads this is set on focus - no problem because it dosent have text. After query is submitted the page is loaded again this the te开发者_JAVA百科xt inside of it but the focus is before the text. Now in FFX recently this dosent word. A while back this dosent worked in opera. :( How can i code this to word on all browsers? .. basically just like in google's box
You should try posting the value on that page. And when page loads again just show that posted value in the textarea.
i.e.
$value = $_POST['q'];
<textarea name='q' rows='3' cols='100' id='q'><?php echo $value; ?></textarea>
精彩评论