• Hi guys! I’ll try and explain to the best of my abilities what I need here.

    So, I’ve made a form-to-cfdb solution for a company that does electrical maintenance in different cities and areas (communes) in Norway (street lights and so on). The function goes like this: On their site, anyone (public) can report an error, using the structured contact form. The reported error message is then displayed in the CFDB data-table next to it. I’ve made an admin-page for the company itself, and paid for the editor plugin so that they can edit the data directly.

    Form/cfdb-page: https://www.anleggselektro.no/melde-feil-test/

    Now, the client does not want all areas (communes) to be displayed at once, but rather that visitors get to chose their desired commune from a drop down which then displays the various error messages below it.

    How can I do this? Is it possible to make different shortcodes only displaying the filtered commune, and then display the shortcodes as just the commune-names in a drop-down?

    I hope this wasn’t too unclear…

    (PS: Also, how can I remove the “Display”-drop down from above the data-table?

    • This topic was modified 8 years, 2 months ago by pragmatikstu.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    I’m not sure I entirely follow, but here are some pointers.

    If you want to populate a CF7 drop-down selection from CFDB: https://cfdbplugin.com/?page_id=1435

    If you are trying to dynamically populate a 2nd drop down based on the selection of a first drop down, then you could write some jQuery in the page that would make an ajax call to a CFDB export link that returns JSON (create that link in the Shortcode builder page) where you could parameterize the “filter” in the export link based on the 1st selection. I’m not sure how that would work with CF7.

    Plugin Author Michael Simpson

    (@msimpson)

    PS. on removing the display drop down on the datatable. Check on datatables.net to see if there is an option you can put in dt_options. Or you might put in CSS to hide it.

    Thread Starter pragmatikstu

    (@pragmatikstu)

    Hi Michael, thank you for your response.

    If you have a look at the current page, the CFDB data-table is displayed to the left. Now, the column where it says “Kommune”, you’ll find the name of the communes (geographical areas) that we want to filter by. Of course, one can simply filter using the search function above the data-table, but the client would like to have all the communes in a drop-down, so that a filtered data-table is only displayed once a particular commune is selected.

    Right now there’s only one commune, “?s”, but let’s say there’s “Oslo” and “Bergen” in there too. The drop-down will then display “?s”, “Oslo”, “Bergen”. When a visitor chooses either of these 3 communes, a CFDB data-table containing only error messages within the chosen commune is displayed below.

    The point of this is to let visitors find error messages within their own commune, and not display all at once. Of course, I can make separate pages with filtered short codes, but that doesn’t feel quite as sophisticated.

    You can see the solution of a competing company here: https://infratek.no/feil_pa_veilys?

    To clarify, no we do not want to populate a second CF7-dropdown.

    I hope what I’m writing here is understandable ??

    Plugin Author Michael Simpson

    (@msimpson)

    If this is a question about having more sophisticated controls on filtering the table, then you may want to put in a plain [cfdb-table] instead of a [cfdb-datatable] then wrap it in a custom datatable implementation or use some other JS Table library that does what you want.

    Thread Starter pragmatikstu

    (@pragmatikstu)

    Thank you so much for your help Michael!

    By the way, is there any way I can change the name of the “Submitted” column header? Would like to have it in Norwegian (Innsendt).

    Thread Starter pragmatikstu

    (@pragmatikstu)

    Oh and by the way again, I’m using “table” instead of “datatable” now. However, the table itself is clickable and opens in a new tab if clicked. I’d like to remove this. Is this something I can add to a shortcode.

    Sorry if this is explained somewhere else!

    Plugin Author Michael Simpson

    (@msimpson)

    Use “headers” to rename the column headers. https://cfdbplugin.com/?page_id=93

    [cfdb-table] just output a plain HTML table. It doesn’t make anything clickable. That must be coming from somewhere else.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Make drop-down from form-submission to filter results?’ is closed to new replies.