Posted by phdfromic on 01/09/06 00:59
I want to set an initial text in a TEXTAREA based on the value selected
in an earlier SELECT box in the same document.
I tried something like
$init_text=set_init_text() ;
<TEXTAREA>
<?php echo $init_text ; ?>
</TEXTAREA>
function set_init_text() {
return <script>
document.forms[0].SelectBox.options[document.forms[0].SelectBox.selectedIndex].value
</script }
But I get a php syntax error with the <script> tag.
What's the correct way to do it ?
Navigation:
[Reply to this message]
|