Public CodeCanyon discussion · WP Cost Estimation & Payment Forms Builder
Question from HappyAgencies
1 direct author reply in this public CodeCanyon conversation.
Is it possible to autofill some fields with GET or POST params?
Hello, There is no direct option to do that, but it can be done by using this code in the "Custom JS" option of the form : var $_GET = {}; jQuery(window).on('load',function(){ if(typeof($_GET.myVariable1) != 'undefined'){ // variable 1 jQuery('[data-title="My item 1 title"]').val($_GET.myVariable1); } if(typeof($_GET.myVariable2) != 'undefined'){ // variable 2 jQuery('[data-title="My item 2 title"]').val($_GET.myVariable2); } }); document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { function decode(s) { return decodeURIComponent(s.split("+").join(" ")); } $_GET[decode(arguments[1])] = decode(arguments[2]); }); Simply replace "myVariable1" and "myVariable2" by the target GET variable names, and "My item 1 title" and "My item 2 title" by the titles of the target items in the form. The variables detected as GET parameters will be fill in the target text fields items in the form .