What I'm doing now is using Zend_Form to create a skeleton of the form with
placeholders, then using unobtrusive javascript to hide those fields. Then,
when the AJAX response is received those elements are populated and shown.
If there's a better way, please let me know. Thanks!
KeefTM wrote:
>
> Hello, I am looking for some information on using Zend_Form. I want to use
> Zend_Form to have dynamic drop downs and options based on what a user
> selected before. I am re-writing an app, so I can not change this behavior
> too much. Let me give you a very brief example of how the form used to
> work, based on a form most people are familiar with:
>
> <form name="search_cars" action="search_cars.php" method="POST">
> <select name="make" onchange="getModels(this);">
> <option value="value1">Honda</option>
> <option value="value2">Ford</option>
> <option value="value3">Toyota</option>
> </select>
> <select name="model" onchange="getYears(this);" disabled>
> </select>
> <select name="years" disabled>
> </select>
> <input type="submit" />
> </form>
>
> <script type="text/javascript">
> function getModels(obj)
> {
> // use ajax call and response to populate model select
> }
>
> function getYears(obj)
> {
> // use ajax call and response to populate years select
> }
> </script>
>
> Now, what is the correct way to re-create this behavior with Zend_Form? I
> know inline javascript is frowned upon. My experience is with the
> Prototype js library for the ajax calls. Thank you for the help.
>
--
View this message in context:
http://www.nabble.com/Zend-Form-dynamic-content-tp21059688p21065820.html
Sent from the Zend Framework mailing list archive at Nabble.com.