开发者

Dojo select widget validation

I am usin开发者_运维技巧g the Dojo select widget, and by default, I am displaying an empty option to user.

I am setting required attribute to true, but Dojo validation is not making / changing background color for the selection when form is submitted,but still it is applying CSS style for other validation text boxes.

I tried to apply my own custom style, but Dojo is overridding those. Is it possible to do required validation on select widget and get coloring?


You can find an example of how required is used in the dojo tests (http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/test_Select.html). If you define the "empty" option without any value that option will be invalid if required = true, like this:

<option>&nbsp;</option>

If you define the options programmatically you define the "empty" option like this:

{label: "&nbsp;"}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜