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\">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值