• Resolved carliotxs

    (@carliotxs)


    Hello, I have a form that I would like to populate with local storage data. Although visually, the data is displayed inside the fields, this data is not on the email submission.

    Thanks in advance for the help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @carliotxs,

    As long the data are passed to the field, it should have displayed the value in the email too. Does the populated value show up for the field after submission under Forminator > Submission?

    Could we know how you populated the data ie the custom code you are currently applying so that we could see what could be suggested?

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter carliotxs

    (@carliotxs)

    Hello, the data isn’t displayed on the submissions screen.

    Here’s my custom code:

    jQuery( "#inquiry-form-buy" ).click(function() {
    localStorage.location=jQuery("#location").text();
    localStorage.diveSite=jQuery("#dive-site").text();
    localStorage.whatWillYouSee=jQuery("#what-will-you-see").text();
    localStorage.diveType=jQuery("#dive-type").text();
    localStorage.spotName=jQuery("#spot-name").text();
    });


    if(jQuery("#inquiry-form-buy-spot").length){

    if(!localStorage.getItem("spotName")){
    window.location = "/search-your-best-dives/";

    return;
    }

    document.title = localStorage.getItem("spotName");

    jQuery(".location-input input").prop("disabled", true);
    jQuery(".dive-site-input input").prop("disabled", true);
    jQuery(".dive-type-input input").prop("disabled", true);
    jQuery(".what-would-you-like-to-see-input input").prop("disabled", true);

    jQuery("#form-spot-name").text(localStorage.getItem("spotName"));
    jQuery(".location-input input").val(localStorage.getItem("location"));
    jQuery(".dive-site-input input").val(localStorage.getItem("diveSite"));
    jQuery(".dive-type-input input").val(localStorage.getItem("diveType"));
    jQuery(".what-would-you-like-to-see-input input").val(localStorage.getItem("whatWillYouSee"));
    }



    Thanks in advance for the help

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @carliotxs ,

    Could you export your form using the guide on this link: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export? Once exported, kindly use a Cloud service like Google Drive, pastebin.com, or similar to share it. If you have sensitive data, please duplicate the form, remove it, and export the form.

    I hope to hear back from you soon.

    Best regards,
    Williams

    Thread Starter carliotxs

    (@carliotxs)

    Hello Williams,

    Here’s my form export https://drive.google.com/file/d/1iXpGlhuZIpYhiObiyxW1ZaQkZv-3tLyo/view?usp=sharing

    Thank you so much for the help.

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @carliotxs,

    Unfortunately, I wasn’t able to examine the form closely because the provided Google Drive URL has restricted access.

    Regarding the JavaScript you shared, it isn’t sufficient to prepopulate a Forminator form field on its own. You’ll need to modify the HTML markup by using the forminator_field_number_markup filter in Forminator to achieve this.

    The following line of code is an example of how you can update a form field.

    $html = str_replace( 'name="number-1"', 'name="number-1" value="'.$custom_number.'"', $html );

    The above-provided code will update a number field in the Form with a custom value.

    I’m afraid providing an exact code will be outside the scope of support we can provide. For that, you’ll need to hire a developer to provide the required custom code for you. WordPress provides a jobs directory here https://jobs.wordpress.net/, if you need further advice about it, feel free to email “[email protected]” with the subject as “ATTN: WPMU DEV support – wp.org”

    Kind Regards,
    Nebu John

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @carliotxs

    We haven’t heard from you in some time, so I will mark this thread as resolved. If you have any more questions or need further assistance, please let us know!

    Kind Regards,
    Amin

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