MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / check_valid

Method check_valid

webiojs/src/models/input/input.ts:100–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99 // 检查输入项的有效性,在表单提交时调用
100 check_valid(): boolean {
101 let valid = !Number.isNaN(this.get_value()) || this.element.find('input').val() === '';
102 if (!valid) {
103 this.update_input_helper(-1, {
104 'valid_status': false
105 });
106 } else {
107 this.update_input_helper(-1, {
108 'valid_status': 0, // remove the valid status
109 });
110 }
111 return valid;
112 }
113
114 update_input(spec: any): any {
115 let attributes = spec.attributes;

Callers 1

create_elementMethod · 0.45

Calls 2

get_valueMethod · 0.95
update_input_helperMethod · 0.80

Tested by

no test coverage detected