Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7634659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:14:09+00:00 2026-05-31T07:14:09+00:00

A user has to select a vehicle type, then based on his selection he

  • 0

A user has to select a vehicle type, then based on his selection he then has options of selecting a vehicle model, then based on that selection he will have the option of viewing specific colours available for that model.

There are separate django models for each of vehicle, model, and colour, where each vehicle instance has many models (many to many field) and each model has colours (many to many field).

How would you create a template so that the user is able to dynamically do this? I don’t want to be redirected to different views. I’m thinking I would need to use jquery so that the user can select the vehicle from a drop down box, then based on his choice another drop down box appears etc..

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:14:11+00:00Added an answer on May 31, 2026 at 7:14 am

    My approach would be to use ajax to dynamically change the content of the select boxes. There are many ways to implement this. Here is one…

    • Create 3 select boxes (vehicle, model, color)
    • Populate the first one with all a blank entry plus all vehicles
    • Trap the onchange event for the vehicle and model and create corresponding javascript functions.

    Here is the sudo code for the vehicleChange function:

    • Clear all model select options
    • Clear all color select options
    • fetch model select options from server using ajax
    • populate model select box.

    Here is the sudo code for modelChange function:

    • Clear color select options
    • fetch color select options from server using ajax
    • populate color select box.

    So now what happens is:

    • Because you are using ajax your page will not refresh or redirect.
    • Your model for “model” and “color” remain as simple as possible
    • Your view for “model” and “color” become very small. One possible view would yield something like:

      <option value=”Red”>Red</option>
      <option value=”White”>Blue</option>
      <option value=”Blue”>Blue</option>

    To change the options in the select boxes you could use jquery to grab the select box and replace the html with the results from the ajax call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a form that has a multiple select drop down. a user can
I have a wizard with several screens where user has to fill his/her details
I am setting up Drupal with a user that has only SELECT (read) rigths
I have a rails form where user has to select a value from a
I have a SELECT where I choose how many cars the user has. After
I have a current mysql user who has SELECT privileges for all the table
I have an iPhone app. The user can select a contact. Upon selection another
I have a User, and that User has a bunch of contacts (some contacts
I have a MySQL DB with a user that has access only a few
A user has sent me some information that they posted to one of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.