• Resolved masterbip

    (@masterbip)


    Hello. First of all thanks a lot for the amazing plugin and job you made.

    This is an example: https://www.theappliancerepairmen.com/

    The “request service” form (just a form) open a modal (after clicking in BOOK ONLINE) with selection applied (or predefined) to Appliance Drop-Down menu

    https://paste.pics/QOYGB

    It is possible with your plugin? Too hard? (im not a php/ajax expert)

    Many thanks in advance!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Your question is very similar to this one (that solution is actually here) but because you’re using different themes, the solution for you won’t be exactly the same.

    DTX can only prefill data on page load. So in situations where you’re on a specific product page and the modal is pre-rendered at the bottom to use the product’s title, that would work. However, in your situation, you’re trying to prepopulate a field based on user engagement which can only be done with JavaScript.

    In JavaScript, you can write a listener for that value to change like this (untested code as I’m writing it here directly):

    $('#appliance2').on('change', function(e){
        let value = $(e.target).val(), // Gets the numeric value
            product_title = $('#appliance2 option[value="'+value+'"]').text(); // Gets the title
    
        // Update the text of the modal with product_title
    });

    But the URL your provided doesn’t show me an example of the modal appearing so I can’t finish the snippet to demonstrate what to do with the information retrieved ??

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    Hello, I’m marking this as resolved as I haven’t heard back from you in a while. If the issue still exists, please create a new one. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dynamic drop-down menu ajax based on prev selection’ is closed to new replies.