You are here: Re: How to retrieve javascript object value in PHP ? « PHP Programming Language « IT news, forums, messages
Re: How to retrieve javascript object value in PHP ?

Posted by Steve on 01/09/06 12:23

On Mon, 09 Jan 2006 09:32:42 +0000, Peter Fox wrote:

No interaction, but php can quite happily write js just as easily as it
can write html/xhtml/xml/...

> 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 ?
>>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация