Custom verification of form fields via JS

For such a check, it is necessary to implement a similar function as.formcallbacks["{formCode}_checkForm"](cont)

<script>
as.formcallbacks["watch_checkForm_checkForm"] = function(cont){
	var errors = [];
  	var el = $('.as-form[data-code=watch_checkForm] .as-form-item[data-code=f1] input');
  	var isnum = /^\d+$/.test(el.val());
  	if(!isnum){
        errors.push({
            el :el,
            text: 'В поле F1 должны быть только цифры!',
          code: 'f1'
        });
    }
	return errors;
}
</script>

The output is expected to be an array of errors, each of which consists of the following fields

  • el - reference to the control (jquery object)
  • text - error text
  • code - field code  

This callback is launched after executing the basic standard check (for the fullness of fields). 

An example of how such a check works: https://demo.web-automation.ru/list/watch/kastom-proverka-poley-formy-cherez-js---53

Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started
{sp-shortDemostandLinks}

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices

Note