{"record":{"id":"7761864241c0eac8","repo":"Semantic-Org/Semantic-UI","slug":"you-must-specify-a-string-identifier-for-each-fiel","errorCode":null,"errorMessage":"You must specify a string identifier for each field","messagePattern":"You must specify a string identifier for each field","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/definitions/behaviors/form.js","lineNumber":1305,"sourceCode":"    input      : 'input',\n    message    : '.error.message',\n    prompt     : '.prompt.label',\n    radio      : 'input[type=\"radio\"]',\n    reset      : '.reset:not([type=\"reset\"])',\n    submit     : '.submit:not([type=\"submit\"])',\n    uiCheckbox : '.ui.checkbox',\n    uiDropdown : '.ui.dropdown'\n  },\n\n  className : {\n    error   : 'error',\n    label   : 'ui prompt label',\n    pressed : 'down',\n    success : 'success'\n  },\n\n  error: {\n    identifier : 'You must specify a string identifier for each field',\n    method     : 'The method you called is not defined.',\n    noRule     : 'There is no rule matching the one you specified',\n    oldSyntax  : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.'\n  },\n\n  templates: {\n\n    // template that produces error message\n    error: function(errors) {\n      var\n        html = '<ul class=\"list\">'\n      ;\n      $.each(errors, function(index, value) {\n        html += '<li>' + value + '</li>';\n      });\n      html += '</ul>';\n      return $(html);\n    },","sourceCodeStart":1287,"sourceCodeEnd":1323,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/form.js#L1287-L1323","documentation":"Semantic UI Form internal error thrown from has.field() (form.js:636-637) when a field identifier passed to validation is not a string. The form relies on identifiers to look up fields by #id, [name=...], or [data-validate=...]; a non-string identifier short-circuits with this console error.","triggerScenarios":"Calling $('.ui.form').form('form', {fields: {...}}) or invoking validation where a field identifier resolves to a number, undefined, null, or object (e.g. building the fields object from a JSON map whose keys became numeric, or passing a DOM node instead of a string).","commonSituations":"Programmatically generating the fields config from server data; using a non-string key when constructing identifiers; calling form('is valid', someElement) with a jQuery object instead of the field name.","solutions":["Ensure every field identifier in the fields object is a string (coerce with String(id) when generating from data).","Confirm the value passed to form methods like 'is valid' / 'add field' / 'remove field' is a string name, not a jQuery or DOM object.","Inspect the second console argument emitted alongside the message to find which identifier is non-string."],"exampleFix":"// before\n$('.ui.form').form('is valid', $('#email')[0]); // DOM node, not identifier\n// after\n$('.ui.form').form('is valid', 'email');","handlingStrategy":"type-guard","validationCode":"function buildFields(raw) {\n  var out = {};\n  Object.keys(raw).forEach(function(k){\n    var id = String(k);\n    if (typeof raw[k] === 'string' || typeof raw[k] === 'object') out[id] = raw[k];\n  });\n  return out;\n}","typeGuard":"function isStringIdentifier(id) { return typeof id === 'string' && id.length > 0; }","tryCatchPattern":null,"preventionTips":["Always quote field identifier keys as strings.","When generating the fields config from server data, coerce keys with String().","Pass field names (not jQuery/DOM nodes) to 'is valid' / 'add field' / 'remove field'."],"tags":["form-validation","semantic-ui","identifier","configuration"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}