Skip to content

Instantly share code, notes, and snippets.

@sholsinger
Created February 17, 2011 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sholsinger/832011 to your computer and use it in GitHub Desktop.
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.
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