dojo validate

大家好,我在使用dijit.form.Textarea的时候,发现没有validate校验功能,我想加上校验功能,现在已经基本实现了,但是如果通过代码给它赋值的时候,却获取不到value值,而input却可以获取到value值,希望大家给予指点。我下面把代码贴出来,就是仿照dijit.form.TextBox改写的:
if(!dojo._hasResource["dijit.form.Textarea"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dijit.form.Textarea"] = true;
dojo.provide("dijit.form.Textarea");

dojo.require("dijit.form._FormWidget");
dojo.require("dijit.Tooltip");

dojo.declare(
"dijit.form.Textarea",
dijit.form._FormWidget,
{
// summary:
// A generic textbox field.
// Serves as a base class to derive more specialized functionality in subclasses.

// trim: Boolean
// Removes leading and trailing whitespace if true.  Default is false.
trim: false,

// default values for new subclass properties
// required: Boolean
// Can be true or false, default is false.
required: false,

// promptMessage: String
// Hint string
promptMessage: "",

// invalidMessage: String
// The message to display if value is invalid.
invalidMessage: "",

// maxlength: String
// HTML INPUT tag maxlength declaration.
maxlength: "999999",
value:"",

templateString:"<textarea dojoAttachPoint='mTextBox,focusNode' dojoAttachEvent='onfocus,onkeyup,onkeypress:_onKeyPress' autocomplete=\"off\"\n\tid='${id}' name='${name}' value='${value}' class=\"dijitTextaArea\">

你可能感兴趣的:(html,工作,dojo)