We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42118
    • 6 Posts
    Hi all -

    I'm not really sure this is a Formit question if I am honest, it's more what I've been asked to do with it! But any pointers at all would be appreciated.

    I've been given an Excel spreadsheet by a customer containing in one column a list of car makes, in the second column a list of models and in the third column a list of variants per model.

    The form is asking people to specify a vehicle. So what he wants is the first drop down to contain a list of car makes, with drop downs two and three empty. When they select a care make, it populates the second select with the available models for that maker, then populates the third dropdown with all the variants once they have selected the model in the second select.

    Now I could probably cobble something together, but the problem is that his Excel spreadsheet is going to change very regularly, as car makes/models/variants become available and unavailable. So really it has to read the Excel file directly, without me hard coding lists of options - which would be a nightmare to update.

    I am sure that it will need a snippet that can read the document (or a CSV version of it) and update the selects. But my PHP skills are pretty non-existent. I have Googled to see if there is some ready made code out there and can't find anything.

    Can anybody tell me if I am going completely down the wrong road - is there a better way to do this? Or is a php snippet my best bet?

    Many thanks in advance - Jon
    • FormIt wouldn't really be of any use for this particular scenario. This is more a Javascript/AJAX application. A snippet to read the spreadsheet file, then the javascript to manage the lists that the snippet will generate.

      There are a number of options for doing this.

      http://www.google.co.il/#hl=en&biw=1280&bih=666&sclient=psy-ab&q=jquery+ajax+linked+select&oq=jquery+ajax+linked+&gs_l=hp.1.0.0i30l2.1557.5364.0.8544.19.13.0.6.6.0.354.2533.0j10j2j1.13.0.les%3B..0.0...1c.1.vQ-j7-Fdigk&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=d10cf305ba930498&bpcl=38625945
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 42118
        • 6 Posts
        Thank you Susan.

        Looks like I've got some learning to do!

        Jon