Support » Plugin: Accept Stripe Payments » Prepopulate Form With Query String Parameters

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Sinisa Bajic – bajs


    This is solved by myself.

    I fetched the query strings, stored them in variables and then after the iframe is loaded added the values to correspondent fields.


    Plugin Support mbrsolution


    That is great news 🙂

    You might like to share your solution for others.

    Kind regards

    Thread Starter Sinisa Bajic – bajs



    // Fetch Query Strings
      function getParameterByName(name, url) {
        if (!url) url = window.location.href;
        name = name.replace(/[\[\]]/g, '\\$&');
        let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, ' '));
    //Store them in variables
      let total = getParameterByName('total');
      let email = getParameterByName('email');
      let full_name = getParameterByName('full_name');
    Since I have different scenarios
    and multiple forms (product shortcodes) on single page
    I am showing different form based on total amount 
    and want the form to open automatically
    if (total == 165.00) {
    setTimeout(function() {
               $(".asp-popup-iframe").load (function(){
               $('.asp-popup-iframe').contents().find('#email').attr('value', email);
              $('.asp-popup-iframe').contents().find('#billing-name').attr('value', full_name);
    else if...
    Plugin Support mbrsolution


    Thank you very much 🙂

    I am sure this will help those with the same requirements.

    Enjoy the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Prepopulate Form With Query String Parameters’ is closed to new replies.