• Resolved cantorienrico

    (@cantorienrico)


    Hi, thank for your plugin.

    You said it is possible prefill fields with jquery.

    I try this solution in functions but don’t work:

    add_action( ‘wp_body_open’, ‘metform_add_userid’ );
    function metform_add_userid() {
    echo ‘<script>
    var selector = “.mf-form-wrapper”;
    jQuery(selector).on(“metform/after_form_load”, function(e, data){
    data[ “form-userid” ] = “‘.get_current_user_id().'”;
    return data;
    });
    </script>’;

    Can you write a working example? and how to insert it?

    Thank in advance for your time.

    Regards,

    Enrico – Italia

Viewing 1 replies (of 1 total)
  • Plugin Support Benjir Ahmed

    (@benjirahmed)

    Hi @cantorienrico ,

    Please add the code as traditional JS Code to call a jQuery hook which injects values to the form after_form_load. Also try to add relevant form id (screenshot) instead of the metform wrapper class.

    But after adding the code as script if it doesn’t work as expected please open a support ticket at our support center. We will help you to solve the problem after proper inspection.

    Regards,
    Benjir

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.