Python Forum
creating an dropdownlist with javascript in django - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: creating an dropdownlist with javascript in django (/thread-408.html)



creating an dropdownlist with javascript in django - shahpy - Oct-10-2016

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


RE: creating an dropdownlist with javascript in django - Skaperen - Oct-10-2016

show us a website where you have seen this.


RE: creating an dropdownlist with javascript in django - wavic - Oct-10-2016

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/ref/request-response/#django.http.HttpRequest.META

The drop down menus are just a HTML forms


RE: creating an dropdownlist with javascript in django - nilamo - Oct-17-2016

(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/ref/request-response/#django.http.HttpRequest.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.


RE: creating an dropdownlist with javascript in django - metulburr - Oct-17-2016

you mean like this?
http://stackoverflow.com/questions/4071630/django-country-state-city-dropdown-list


RE: creating an dropdownlist with javascript in django - shahpy - Feb-03-2017

(Oct-17-2016, 06:54 PM)metulburr Wrote: you mean like this?
http://stackoverflow.com/questions/4071630/django-country-state-city-dropdown-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


RE: creating an dropdownlist with javascript in django - nilamo - Feb-03-2017

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.