Reply to Re: javascript and php form

Your name:

Reply:


Posted by Chuck Anderson on 10/09/06 21:09

@net wrote:
> hi everyone,
>
> this is not exactly php question, but I need to call javascript inside
> php script. now the question:
>
> <form name="myForm"....
> <tr><td><select name="mySelect" onChange="recreate(myForm)"...
>
> where recreate represent javascript function:
>
> function recreate(form)
> {
> var input=document.form.mySelect.value;
>
> ...
> }
>
> how can I create new objects inside myForm depending on mySelect value
> ? (I know how to enable them but it's more elegant to display them
> based on previous selection inside mySelect)
>
> thx.
>
>
You have to do it all within the Javascript - recreate() - based on the
value of MySelect.

You can use Php to build the JavaScript function(s) / object(s), so all
possible combinations are already within the source of the page, but the
secondary select forms must be altered or made visible (or some other
technique - use the DOM) via JavaScript. Php can not call Javascript. It
runs on the server and is gone by the time the page loads in the client
browser.

Once the page is on the browser, you need to use JavaScript to create
the page dynamics. For the relevant JavaScript Google 'Dynamic Forms
Select' or something similar.

The alternative is to reload the page - make a return trip to the server.


--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************

[Back to original 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

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