| | |
| | | input: 'input[type="number"]' |
| | | }, |
| | | limits: { |
| | | hasLimit: '[data-limit]', |
| | | hasLimit: '[data-maxlength]', |
| | | limit: '.limit', |
| | | current: '.current', |
| | | } |
| | |
| | | |
| | | let id = window.generateID('limit'); |
| | | input.dataset.charLimitId = id; |
| | | input.dataset.limit = field.dataset.limit; |
| | | input.dataset.limit = field.dataset.maxlength; |
| | | |
| | | let config = { |
| | | element: input, |
| | |
| | | }; |
| | | |
| | | if (config.ui.limit) { |
| | | config.ui.limit.textContent = field.dataset.limit; |
| | | config.ui.limit.textContent = field.dataset.maxlength; |
| | | } |
| | | |
| | | this.charLimits.set(id, config); |
| | |
| | | if (!form) return; |
| | | |
| | | // Get all current data for the collection |
| | | const value = this.getFieldValue(field.querySelector('input, select, textarea')); |
| | | const value = this.getFieldValue(field); |
| | | this.updateItem(field.dataset.field, value, form); |
| | | } |
| | | /********************************************************************** |