Posted by Peter Fox on 01/09/06 11:32
Following on from 's message. . .
>I want to set an initial text in a TEXTAREA based on the value selected
>in an earlier SELECT box in the same document.
Sorry but you have completely mis-understood how php works.
Client browser - "Web server! send me this resource"
Web server - "OK" [ FX rummages around while running AND FINISHING a php
script] "Here it is now - Thank you and have a nice day"
Client browser - "User I will show you the HTML just sent to me by the
server"
Javascript = client side
php = server side. [ie no interaction]
>
>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.selectedInde
>x].value
></script }
>
>
>But I get a php syntax error with the <script> tag.
>
>What's the correct way to do it ?
>
--
PETER FOX Not the same since the pancake business flopped
peterfox@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Navigation:
[Reply to this message]
|