#4278 closed defect (invalid)
cannot set onfocus event for DateTextBox widget
Reported by: | guest | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit - Form | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The following code demonstrates the problem. In ie 7, nothing happens when clicking on the DateTextBox? widget after setting an onfocus event. In firefox, it behaves erratically:
<html>
<head>
<script type="text/javascript" src="/js_libs/dojo_root/dojo/dojo.js"
djConfig="parseOnLoad: true, isDebug: 'true'"></script>
<script type="text/javascript" src="/js_libs/dojo_root/dijit/dijit.js"></script>
<style type="text/css">
@import "/js_libs/dojo_root/dojo/resources/dojo.css"; @import "/js_libs/dojo_root/dijit/themes/tundra/tundra.css";
</style>
<script type="text/javascript">
dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?");
</script>
<script type="text/javascript">
function focus_date() {
dojo.byId("output").innerHTML += "focused date<BR>";
}
function init() {
elem = dijit.byId('mydate'); dojo.connect(elem, 'onfocus', null, "focus_date");
}
dojo.addOnLoad(init);
</script>
</head>
<body class=tundra>
<input widgetid='mydate' name='mydate' type="text"
value='2007-08-22' dojoType="dijit.form.DateTextBox?" constraints={datePattern:'dd-MMM-yyyy'} promptMessage="dd-MMM-yyyy" invalidMessage="Invalid date. Use dd-MMM-yyyy format." /> <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <div type=text id=output></div>
</body>
</html>
Change History (2)
comment:1 Changed 13 years ago by
Component: | General → Dijit |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
DateTextBox? doesn't have an onfocus method, so this isn't a bug but rather an ER, I suppose. You should be able to attach to _onFocus to get what you want