dhtmlxForm submit for file upload

Hi,
I have a dhtmlxForm instantiated as follows:


<form id="uploadForm" style="overflow: hidden;" target="dynamicIFrame" accept-charset="UTF-8" method="POST" action="fileUpload.do" enctype="multipart/form-data">
	<div id="form" style="display:none;margin-left:10px;margin-top:10px;">
		<div class="content">
			<div id="listObj" style="position: relative;"></div>
		</div>
	</div>
</form>

<script>
var formData = [{type:"file",name:"documentUpload",
					id:"documentUpload",
					label:"Attachment"
				}
				];

var form = new dhtmlXForm("listObj", formData);
</script>

However,
when this html form is submitted, the servlet does not receive the ‘documentUpload’ parameter.
There is no mulipart file uploaded to the servlet.

Also,
How do I find out , on the client, if the user has attached a document?
getItemValue() does not seem to work on input file type. Also the “onchange” event is not triggered when a file is selected through the file picker (or even if some characters are entered into the input field of the element)

Please help.

Hello,

  1. You need to use submit button for submit file, see here viewtopic.php?f=17&t=17568

  2. Event triggering - please use attached form.js (it’s 3.0)
    dhtmlxform.js.zip (14.8 KB)

Thanks !

However, with the new dhtmlxform.js that you have provided, all the styles for the dhtmlxform are gone. (The alignment seems okay, but the fonts, checkbox images,etc are absent)