Last active
December 4, 2017 08:22
-
-
Save ihorduchenko/9b12d82f7582f839d3454023e6ccbcb0 to your computer and use it in GitHub Desktop.
Increment in WP loop
This file contains hidden or 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
(function ($) { | |
var i = 1; | |
$("input[name=your-name], input[name=your-phone], input[name=your-email], textarea[name=cover-letter], input[name=file-attachment]").each(function () { | |
i++; | |
var curParentName = $(this).parents("form").attr("name"); | |
var inputName = curParentName[curParentName.length-1]; | |
console.log(inputName); | |
$(this).attr("name", $(this).attr("name")+inputName); | |
}) | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment