xowiki::Page instproc www-validate-attribute (public)

 <instance of xowiki::Page[i]> www-validate-attribute

Defined in packages/xowiki/tcl/xowiki-www-procs.tcl

This web-callable method can be used to validate form attributes, typically called via AJAX.

Partial Call Graph (max 5 caller/called nodes):
%3 xo::localize xo::localize xowiki::Page instproc www-validate-attribute xowiki::Page instproc www-validate-attribute xowiki::Page instproc www-validate-attribute->xo::localize

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 $error
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: