Python Forum
creating an dropdownlist with javascript in django
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
creating an dropdownlist with javascript in django
#1
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
Reply
#2
show us a website where you have seen this.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#3
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
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#4
(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.
Reply
#5
you mean like this?
http://stackoverflow.com/questions/40716...pdown-list
Recommended Tutorials:
Reply
#6
(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
Reply
#7
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  creating an exe file for a python django project Sanjish 0 2,572 Dec-27-2020, 07:33 AM
Last Post: Sanjish
  Django - Am I in the right direction for creating the models of my Phone Review appli shawnmichaels583583 0 1,798 Oct-15-2019, 06:25 AM
Last Post: shawnmichaels583583
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,218 Jun-30-2019, 12:21 AM
Last Post: scidam
  Error while creating new Creating Models on Django aniyanetworks 2 5,266 Jul-13-2018, 12:57 PM
Last Post: aniyanetworks
  Django - Passing data from view for use client side with JavaScript in a template bountyhuntr 0 3,589 Jun-11-2018, 06:04 AM
Last Post: bountyhuntr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020