Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.160 -r1.161 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 21 Nov 2009 00:42:11 -0000 1.160 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 24 Nov 2009 14:08:36 -0000 1.161 @@ -48,6 +48,7 @@ {help_text ""} {error_msg ""} {validator ""} + {validate_via_ajax} locale default object @@ -392,6 +393,17 @@ # If no special renderer is defined, we fall back to this one, # which is in most cases a simple input fied of type string. # + if {[my exists validate_via_ajax] && [my validator] ne ""} { + set ajaxhelper 1 + ::xowiki::Includelet require_YUI_JS -ajaxhelper 0 "yahoo/yahoo-min.js" + ::xowiki::Includelet require_YUI_JS -ajaxhelper 0 "dom/dom-min.js" + ::xowiki::Includelet require_YUI_JS -ajaxhelper 0 "event/event-min.js" + ::xowiki::Includelet require_YUI_JS -ajaxhelper 0 "connection/connection-min.js" + ::xo::Page requireJS "/resources/xowiki/yui-form-field-validate.js" + set package_url [[[my object] package_id] package_url] + ::xo::Page requireJS "YAHOO.xo_form_field_validate.add('[my id]','$package_url');" + } + ::html::input [my get_attributes type size maxlength id name value disabled {CSSclass class}] {} # # Disabled fieds are not returned by the browsers. For some