lera.cernolev
8/14/2019 - 4:25 PM

Send form fields values to URL

<script>
window.instapageFormSubmitSuccess = function (form) {
  var queryString = '';
  $(form).find('input[type="text"], input[type="email"], select, textarea, input[type="checkbox"]:checked, input[type="radio"]:checked').each(function () {
    queryString += '&' + $(this).attr('name').toLowerCase().replace(/\ /g, '_') + '=' + encodeURI($(this).val());
  });
  queryString = queryString.replace('&', '?');

  var redirect_url = $(form).find('input[name="redirect"]').val();
  $(form).find('input[name="redirect"]').val(redirect_url + queryString);
}
</script>