#6267 closed defect (invalid)
ValidationTextBox and TextBox do not set default value from input attribute "value"
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dijit - Form | Version: | 1.1b1 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
In latest SVN codebase (also in 1.0 as well), there is a bug in that you cannot set the value attribute in layout, and get a default value to show up in the form, and populate on form reset. I have modified the templates slightly on both, and it seems to have fixed the problem.
output of svn diff:
Index: dijit/form/templates/TextBox.html =================================================================== --- dijit/form/templates/TextBox.html (revision 13154) +++ dijit/form/templates/TextBox.html (working copy) @@ -1,4 +1,4 @@
<input class="dijit dijitReset dijitLeft" dojoAttachPoint='textbox,focusNode' name="${name}"
dojoAttachEvent='onmouseenter:_onMouse,onmouseleave:_onMouse,onfocus:_onMouse,onblur:_onMouse,onkeypress:_onKeyPress'
- autocomplete="off" type="${type}"
- /> No newline at end of file
+ autocomplete="off" type="${type}" value="${value}' + /> Index: dijit/form/templates/ValidationTextBox.html =================================================================== --- dijit/form/templates/ValidationTextBox.html (revision 13154) +++ dijit/form/templates/ValidationTextBox.html (working copy) @@ -6,7 +6,7 @@
<div class="dijitReset dijitValidationIconText">Χ</div <div class="dijitReset dijitInputField" <input class="dijitReset" dojoAttachPoint='textbox,focusNode' dojoAttachEvent='onfocus:_update,onkeyup:_update,onblur:_onMouse,onkeypress:_onKeyPress' autocomplete="off"
- type='${type}' name='${name}'
+ type='${type}' name='${name}' value='${value}'
/></div
</div </div>
Attachments (1)
Change History (3)
Changed 13 years ago by
Attachment: | textbox.diff added |
---|
comment:1 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is by-design. The form widgets are not just wrappers to native elements. The value attribute is special. So for DateTextBox? widgets, the value is something like 2008-12-31 but the value in the textbox is localized and internationalized. Users should call getValue() to get the true value, and setVaue to set it programmatically. Each TextBox? subclass supports the reset() method. Please refer to dijit.tests/form/test_validate.html for an example. The Form widget also has a reset() method that is called on the reset event (please see dijit/tests/form/Form.html for an example).
comment:2 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Output of svn diff (screwed up in ticket)