PDA

View Full Version : File type text field is not resetting



p_acharya
13 May 2010, 11:07 PM
I am using textfield of type file to upload a file. In mozilla form.reset does reset the file text field. However in IE it is not happening. How to clear the file textfield

p_acharya
31 May 2010, 1:54 AM
Got It and it is quick fix recreate the file component again

fileField = document.getElementById("filefieldName");
parentNod = fileField.parentNode;
tmpForm = document.createElement("form");
parentNod.replaceChild(tmpForm,fileField);
tmpForm.appendChild(fileField);
tmpForm.reset();
parentNod.replaceChild(fileField,tmpForm);