Last active
August 12, 2019 03:08
-
-
Save jrevillini/4c18d6265ea3e2369d9813210ed122b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this should work in most cases to fix escaped quotes when querystring var has a quote (' or ") and is the value of an input or textarea | |
// it does not handle hidden fields ... feel free to improve on it or leave a comment with ideas | |
jQuery( function ( $ ) { | |
$( document ).on( 'nfFormReady', function ( ) { | |
$( 'textarea.ninja-forms-field,input[type=text].ninja-forms-field' ).each( function () { | |
var $input = $(this), | |
val = $input.val(); | |
val = val.replace(/\\'/gm,"'").replace(/\\"/gm,'"'); | |
$input.val(val).change(); | |
} ); //each | |
} ); // nfFormReady event | |
} ); // ready |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment