[Phplib-users] oohforms textarea validation patch (fwd)
Brought to you by:
nhruby,
richardarcher
From: Tarique S. <ta...@sa...> - 2002-02-13 15:44:03
|
Hi this did not make it to the list Tarique -- ========================================================== PHP Applications for E-Biz : http://www.sanisoft.com The Ultimate Ghazal Lexicon: http://www.aaina-e-ghazal.com ========================================================== ---------- Forwarded message ---------- Date: Wed, 13 Feb 2002 18:25:05 +0530 (IST) From: "Tarique Sani <ta...@sa...>" <ro...@bo...> To: Matt Williams <ma...@ye...> Subject: oohforms textarea validation patch Hi All, The following is a JavaScript minlength test for textarea - someone with more time can elaborate it for rest of the stuff and also the serverside stuff put these lines in of_textarea.inc at the proper place ===================================== function self_get_js($ndx_array) { $str = ""; reset($ndx_array); while (list($k,$n) = each($ndx_array)) { if ($this->length_e) { $str .= "if (f.elements[${n}].value.length < $this->minlength) {\n"; $str .= " alert(\"$this->length_e\");\n"; $str .= " f.elements[${n}].focus();\n"; $str .= " return(false);\n}\n"; } } return $str; } =================================== Hope that helps Tarique -- ========================================================== PHP Applications for E-Biz : http://www.sanisoft.com The Ultimate Ghazal Lexicon: http://www.aaina-e-ghazal.com ========================================================== |