On Mon, Jul 6, 2009 at 8:25 AM, sreepathy reddy<[email protected]> wrote:
> hi all......
>
> plz help me...
>
> how to create two dropdowns in pylons
>
> 1. first create a table inserting some values and the table values assing
> the first drop-dwon list
>
> 2. u select the 1st drop-down list value, automaticaly chenge second
> drop-down list values.
>
> for example:-
>                       suppose first drop-down list is country, second
> drop-down list is state
>
>                             i) the first drop-down list values taken from
> countries table, and second drop-down list
> values taken from states table from database.
>
>                           ii) after u select the one country suppose USA in
> first drop-down list, than second drop-down list automaticaally
> show the USA states
>
>                           iii)  u select the one country suppose UK in first
> drop-down list, than second drop-down list automaticaally
> show the UK states only
>
>
>
> plz help me................and  tq

You'll have to use Javascript to change a dropdown list based on
another dropdown list.  Consult a Javascript reference for this.
You'll have to create an action in your application to return a list
of states.  For instance, if the Javascript notices that the country
has been set to US, it might request /ajax/states/US, and the action
might return  a JSON list of (state_id, state_name) pairs, which the
Javascript would put into the droptown.

However, Pylons' @jasonify raises a warning when converting a list,
citing this possible attack:
http://wiki.pylonshq.com/display/pylonsfaq/Warnings

I'm not sure what's best in this case.  You could ignore the warning,
or return a text file containing one state per line (with the first
word in the line being the ID).

(Attention Ben: the URL in the warning is out of date.)

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to