Opened 6 years ago
Last modified 4 years ago
#18736 assigned defect
Double input node in FileInput widget
Reported by: | zkovanda | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.14 |
Component: | DojoX Form | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Using dojox.form.FileInput? widhet results in doubled input tag. This node:
<input data-dojo-type="dojox.form.FileInput?" id="user_logo" name="user[logo]" />
is expanded to the following block:
<div widgetid="user_logo" class="dijitFileInput ">
<input id="user_logo" class="dijitFileInputReal" dojoattachpoint="fileInput" name="user[logo]" type="file"> <div class="dijitFakeInput">
<input id="user_logo" name="user[logo]" tabindex="0" class="dijitFileInputVisible" dojoattachpoint="focusNode, inputNode" type="text"> <div class="dijitInline dijitFileInputText" dojoattachpoint="titleNode">Browse ...</div> <div class="dijitInline dijitFileInputButton" dojoattachpoint="cancelNode" dojoattachevent="onclick:reset">Cancel</div>
</div>
</div>
Final block contains 2 input HTML elements with same is and name:
<input id="user_logo" name="user[logo]" type="file" class="dijitFileInputReal" dojoattachpoint="fileInput" > <input id="user_logo" name="user[logo]" type="text" class="dijitFileInputVisible" dojoattachpoint="focusNode, inputNode" tabindex="0" >
Submitting of the form with this HTML block leads to sending incorrect data to form handler and the file is not uploaded to a server.
My workaround:
- Copy of widget "FileInput?" to "FileInputExt?"
- Add following code line to widget function startup():
this.inputNode.setAttribute('name', 'fake-' + this.inputNode.getAttribute('name'));
Change History (3)
comment:1 Changed 6 years ago by
Component: | General → DojoX Form |
---|---|
Owner: | set to dante |
comment:2 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Owner: | dante deleted |
Status: | new → assigned |
comment:3 Changed 4 years ago by
Milestone: | 1.13 → 1.14 |
---|