xowiki::Page instproc www-validate-attribute (public)
<instance of xowiki::Page> www-validate-attribute
Defined in /var/www/openacs.org/packages/xowiki/tcl/xowiki-www-procs.tcl
This web-callable method can be used to validate form attributes, typically called via AJAX.
- Testcases:
- No testcase defined.
Source code: set field_names [:field_names] set validation_errors 0 # # Get the first transmitted form field. # foreach field_name $field_names { if {[::xo::cc exists_form_parameter $field_name]} { set form_fields [:create_form_field $field_name] set query_field_names $field_name break } } lassign [:get_form_data -field_names $query_field_names $form_fields] validation_errors category_ids set error "" if {$validation_errors == 0} { set status_code 200 } else { set status_code 406 foreach f $form_fields { if {[$f error_msg] ne ""} { set error [::xo::localize [$f error_msg] 1] } } } ns_return $status_code text/html $errorXQL Not present: Generic, PostgreSQL, Oracle