Appnitro Software Forums » MachForm 2

Populate dropdown choices dynamically


  1. Hi,

    I'd like to populate the choices for a dropdown from a table rather than enter the choices in MachForm.

    Further, I'd like the choices to be dependent on a prior dropdown.

    For example, if the first dropdown is "Select Car Manufacturer" it will list Audi, Ferrari, Ford, Lamborghini, etc using a SELECT DISTINCT query. If the second dropdown is "Select Model", and the Car Manufacturer selected is "Ford" it will list Expedition, Exploder, Fiesta, Focus, etc using a SELECT WHERE query.

    Your help will be greatly appreciated.

    Posted 4 months ago #
  2. Sorry, I'm afraid this won't be possible.


    MachForm Founder

    Posted 4 months ago #
  3. evantanski
    Member

    You can do it with Ajax:

    With jQuery :
    $('#select1').change(function(){
    $.ajax({
    //Send to php script category id. This script returns all subcategoties
    $.ajax({
    type: "POST",
    url: location.href,
    data: data,
    success : function (data)
    {
    // Your return categories in data
    // Append list options to select2
    }
    });

    });

    Posted 4 months ago #
  4. jpello
    Member

    Evantanski, Can you give me a little more info on this?

    I'm not a hardcore coder and would like to have something similar, for example:

    Dropdown: Select your activity type:

    Options: Spa, Golf, Theme Park

    When user selects one, different options appear in the next box... (Click Spa, and it gives you options such as Massage, etc.)

    Posted 3 months ago #

RSS feed for this topic

Reply