Opened 4 years ago

Last modified 2 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:

this.inputNode.setAttribute('name', 'fake-' + this.inputNode.getAttribute('name'));

Change History (3)

comment:1 Changed 4 years ago by bill

Component: GeneralDojoX Form
Owner: set to dante

comment:2 Changed 4 years ago by dylan

Milestone: tbd1.12
Owner: dante deleted
Status: newassigned

comment:3 Changed 2 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.