admin管理员组文章数量:1317898
I really get confused when I'm attempting to create a password input with Dojo, the following is the related code fragment:
HTML: <input id="password" type="password">
JavaScript:
var passwordInput = new ValidationTextBox({
name: "password",
}, "password");
I seems that the input with type of password doesn't work and the below is the effect sketches, which is the plaintext:
Meanwhile, I cannot find another Dojo widget can use as a password purpose, and I also don't think Dojo doesn't support it. So can anybody give me ideas on this issue?
Thnaks in advance.
I really get confused when I'm attempting to create a password input with Dojo, the following is the related code fragment:
HTML: <input id="password" type="password">
JavaScript:
var passwordInput = new ValidationTextBox({
name: "password",
}, "password");
I seems that the input with type of password doesn't work and the below is the effect sketches, which is the plaintext:
Meanwhile, I cannot find another Dojo widget can use as a password purpose, and I also don't think Dojo doesn't support it. So can anybody give me ideas on this issue?
Thnaks in advance.
Share Improve this question asked Nov 5, 2013 at 9:21 Brady ZhuBrady Zhu 1,4055 gold badges23 silver badges45 bronze badges 2- which dojo version do you use? – nozzleman Commented Nov 5, 2013 at 9:25
- and which browser & version? 'cause this works for me see jsfiddle/HkXtr/1 – nozzleman Commented Nov 5, 2013 at 9:29
3 Answers
Reset to default 5Try to use the type
param
var passwordInput = new ValidationTextBox({
type: "password"
}, "password");
You can create it by the following two ways:
1.Declarative example:
<input id="password" name="password" type="password" required="true" data-dojo-type="dijit/form/ValidationTextBox" tabindex="0" invalidMessage:'Please enter password.'">
2.Programmatic example
var password = new ValidationTextBox({
name: "password",
type: "password"
}, "password");
Instead of ValidationTextBox use TextBox and set property type:'password'
new TextBox({
type:'password'
},'pass');
you can check it live JSFIDDLE
本文标签: javascriptHow to create a password input with DojoStack Overflow
版权声明:本文标题:javascript - How to create a password input with Dojo? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742034785a2417135.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论