Created
February 17, 2011 16:11
-
-
Save sholsinger/832011 to your computer and use it in GitHub Desktop.
A quick and dirty report of the unique input names on my page.
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
var report = { | |
run: function () | |
{ | |
return $("form :input[name!='']").filter(this.isUniqueField); | |
}, | |
isUniqueField: function (index) | |
{ | |
if(report.elementNameCache.indexOf(this.name) < 0) { | |
report.elementNameCache.push(this.name); | |
return true; | |
} | |
return false; | |
}, | |
elementNameCache: [] // by the end, this will contain all the unique names of your inputs. | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment