Skip to content

Commit

Permalink
Merge pull request jsonform#199 from duffar12/master
Browse files Browse the repository at this point in the history
Added support for a htmlMetaData form property. 

This property can be used to add additional html metadata
  • Loading branch information
tchapi authored Jan 8, 2019
2 parents 9497549 + 10ad3e9 commit b36320f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/jsonform.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,14 @@ var initializeTabs = function (tabs) {

// Twitter bootstrap-friendly HTML boilerplate for standard inputs
jsonform.fieldTemplate = function(inner) {
return '<div class="form-group jsonform-error-<%= keydash %>' +
return '<div ' +
'<% for(var key in elt.htmlMetaData) {%>' +
'<%= key %>' +
'=" ' +
'<%= elt.htmlMetaData[key] %>' +
'" ' +
'<% }%>' +
'class="form-group jsonform-error-<%= keydash %>' +
'<%= elt.htmlClass ? " " + elt.htmlClass : "" %>' +
'<%= (node.schemaElement && node.schemaElement.required && (node.schemaElement.type !== "boolean") ? " jsonform-required" : "") %>' +
'<%= (node.readOnly ? " jsonform-readonly" : "") %>' +
Expand Down

0 comments on commit b36320f

Please sign in to comment.