Open walid-ajaj opened 2 years ago
https://github.com/mdelrosso/sheepit/blob/7318e91e951ff139cf02a05bcc7901ec762b0d15/jquery.sheepItPlugin.js#L155
normalizeFieldsForForm() function through an error in case the element (input) had no name or id attributes
normalizeFieldsForForm()
name
id
Below is my suggestion for the fix:
var that = $(this) ,idTemplateAttr = getOrSetTemplate(that,"id") ,nameTemplateAttr = getOrSetTemplate(that, "name") ,idAttr = that.attr("id") ,nameAttr = that.attr("name") /* Normalize field name attributes */ newNameAttr = nameTemplateAttr ? nameTemplateAttr.replace(options.indexFormat, index) : nameAttr; that.attr("name", newNameAttr); /* Normalize field id attributes */ newIdAttr = idTemplateAttr ? idTemplateAttr.replace(options.indexFormat, index) : idAttr; idAttr ? form.find("label[for='"+idAttr+"']").each(function(){ $(this).attr("for", newIdAttr); }) : null; that.attr("id", newIdAttr);
https://github.com/mdelrosso/sheepit/blob/7318e91e951ff139cf02a05bcc7901ec762b0d15/jquery.sheepItPlugin.js#L155
normalizeFieldsForForm()
function through an error in case the element (input) had noname
orid
attributesBelow is my suggestion for the fix: