Hoppa till innehåll
This package has changed name, was previously @soleil/config-validate.
More information

@soleil-se/config-validate

Simple config validation.
Validate configuration with the built in validation in the browser, for most common use cases such as required, simple formatting (mail, url tel) and so on.

Terminal window
npm i @soleil-se/config-validate

In ./config/config.js or ./config_global/config.js we need to register the validate function on the window object.
https://developer.sitevision.se/docs/webapps/configuration/config.js#h-Validate

import { registerConfigValidate } from '@soleil-se/config-validate';
registerConfigValidate();

All styling that is needed is appended to head. To add a required asterisk after a label add the class control-label--required.

<div class="form-group">
<label class="control-label control-label--required">Text</label>
<input class="form-control" name="text" required>
</div>