[Forminator] Fill in fields from URL

I would like to send my clients a link to a form that would be automatically filled with data taken from the URL. Can you help me with that?

  • Nithin
    • Support Wizard

    Hi sushling,

    I have attached a custom plugin regarding this. Please upload the plugin in the /wp-content/plugins folder, and then see whether the form works fine.

    It should autofill the email field when the email parameter is passed as following

    https://example.com/form-page/?email=some@email.com

    Please make sure to clear the browser cache once the plugin has been activated. Have a nice day ahead.

    Regards,

    Nithin

  • Nithin
    • Support Wizard

    Hi sushling,

    Yes, to add more fields, and term just edit the mentioned code to the following in forminator-fill.php file found inside the /forminator-fill folder in the plugin side. From:

    $forminator_fields = array(
    // Put the fields here
    "email-1" => "email",
    );

    To:

    $forminator_fields = array(
    "name-1" => "name",
    "email-1" => "email",
    );

    Where “name-1” would be the field ID noticed in the Forms, and the “name” would be the query passed in the URL. The above is an example when the “Name” field is used.

    So once the code is updated, the URL would be like:

    yoursite.com/?name=bac&email=abc@gmail.com

    Hope this helps. Have a nice day ahead.

    Best Regards,

    Nithin

  • urban
    • New Recruit

    I downloaded your plugin but I can’t get it to work,

    as the selection I try to pass is a dropdown

    $forminator_fields = array(

    “select-1” => “package”,

    “select-2” => “room”,

    );

    I changed that to pass 2 variables via URL

    mydomain.com/?package=g-j-w-h-f&room=d-d-s

    any suggestions?

  • Nithin
    • Support Wizard

    Hi urban,

    The solution shared is more regarding the input fields, Select fields won’t work out of the box. I tried a couple of workarounds but I’m afraid it doesn’t seem to help much. I’m checking with the developer to see whether there is any suggestion that could be applied to make it work with Select fields.

    Will keep you posted once I get further feedback.

    Kind Regards,

    Nithin

  • Nithin
    • Support Wizard

    Hi urban,

    Please try the following attached code. It has already been modified to your required needs ie:

    'select-1' => 'package',
    'select-2'=>'room',

    So it should work like the following:

    yourSiteURL.com/?package=gold&room=one

    Where “gold”, and “one” are examples, and they should be replaced with the Select option values added in the Select field.

    Kind Regards,

    Nithin

  • sascha
    • The Bug Hunter

    Hi, thank you for adding more options to this, well appreciated :slight_smile:

    I have just realized a new Forminator version 1.8 came out and I wonder, if this “autofill-by-URL” feature as being discussed here is already included? Or shall we keep on using the “forminator-fill” extension which you have provided in your latest reply, Nithin?

    Thank you,

    Sascha

  • Nithin
    • Support Wizard

    Hi sushling,

    The above is more of a workaround, and I’m afraid there isn’t any such feature in the latest Forminator plugin side at the moment regarding such a workflow. It’ll still require custom coding, and the above-mentioned plugin should help with making this work.

    I’ll make sure to check with our team regarding any such features could be included down the roadmap or not too.

    Kind Regards,

    Nithin

  • Tobias
    • Flash Drive

    Hi Nithin,

    I have tried your plugin, thanks a lot. It works fine with normal text fields, but I want to use it with hidden fields. Means the parameters I pass should be in invisible fields and only be put in the mails.

    Is this also possible somehow?

    Thanks in advance,

    Tobias

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.