Dojo表单上传不显示文本框

时间:2012-10-25 12:30:23

标签: file-upload dojo

<input name="uploadedFile" type="file" id="uploader"  
   data-dojo-type="dojox/form/Uploader" 
   data-dojo-props="style:'height: 26px; width: 75px; '"  label="Browse"  /> 

上面的代码仅显示标签和“浏览”按钮,而不是文本框。如何分别显示标签文本框和浏览按钮。

1 个答案:

答案 0 :(得分:0)

请参阅此处的测试:http://download.dojotoolkit.org/release-1.8.1/dojo-release-1.8.1/dojox/form/tests/test_Uploader.html

在data-dojo-props中指定showInput:'before'选项。

<form method="post" action="UploadFile.php" id="myForm2" enctype="multipart/form-data" >
     <fieldset>
        <legend>Inline Browse Button Form Post Test</legend>
        <div data-dojo-type="dojox.form.Uploader" id="uploader2" data-dojo-props="name:'uploadedfile',showInput:'before',isDebug:true">Browse</div>
        <input type="text" name="album" value="Summer Vacation" />
        <input type="text" name="year" value="2011" />
        <input type="button" id="remBtn2" label="Clear" dojoType="dijit.form.Button" />
        <input type="submit" label="Submit" dojoType="dijit.form.Button" />
        <div id="files2" dojoType="dojox.form.uploader.FileList" uploaderId="uploader2"></div>
    </fieldset>
</form>