bhima icon indicating copy to clipboard operation
bhima copied to clipboard

Update bhInputText component

Open jmcameron opened this issue 2 years ago • 0 comments

Update the bhInputText component to support the on-change function validating the input. For instance, if you want to enter text which meets some rule, the on-change function could do that validation. It would need someway to affect the validity of for form element. This could be done by adding support for an optional third argument to the on-change function.

See client/src/modules/shipment/modals/edit-container.modal.* for an example that could take advantage of this functionality to remove the form hacking from the javascript code.

While doing this, remove the $submitted part to client/src/modules/templates/bhInputText.tmpl.html so that the validation on these fields happens immediately, not just when [Submit] is clicked.

VS Code regular expression to find relevant on-change items: <bh-input-text[\s\na-zA-Z0-9$._=-"]+on-change

jmcameron avatar Aug 05 '22 11:08 jmcameron