Python Forum

Full Version: creating an dropdownlist with javascript in django
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello

i have a question in django.
i hope you can help me.
i want to to get address of user when he is signing up.

i want to have a dropdownlist that he chooses his state in that and when he select his state

the list of cities of that state be in another field. just like a lot of site that are this way.

i searched for it but i coudnt find how can i do that.
please help me

can you send a project for me that has this?

thanks
show us a website where you have seen this.
The address is in the request object and is stored as a pear (IP, port). I don't know django but I found it in the documentation.
Look at https://docs.djangoproject.com/en/1.10/r...quest.META

The drop down menus are just a HTML forms
(Oct-10-2016, 08:08 AM)wavic Wrote: [ -> ]The address is in the request object and is stored as a pear (IP, port). I don't know django but I found it in the documentation.
Look at https://docs.djangoproject.com/en/1.10/r...quest.META

The drop down menus are just a HTML forms

OP's talking about city/states, not IP addresses :p

Also, why are you posting here?  That's an html/javascript thing, not a python/django thing.
(Oct-17-2016, 06:54 PM)metulburr Wrote: [ -> ]you mean like this?
http://stackoverflow.com/questions/40716...pdown-list

yes something like this .
i could do it with ajax call
i didn't now how can i make an ajax call in django but now it's ok
Exactly the same way you do any page in django, except with a template that's blank so you don't include all the <html><head>css/js</head><body> stuff.