[Javascript] set the value to the file filed dynamically in IE

Selvaraj, Murugan (Indsys) Murugan.Selvaraj at geind.ge.com
Tue Oct 29 09:48:33 CST 2002


Hi All

Here with i am describing the problem with file filed,.
Requirement:
1. Have a parent page with click hyper link and the file filed 
2. Hide the file filed as well as the browse button in the parent window.
3. When the button is cliked , the pop up page (window.open) should be opend
with the file filed and browse button and submit button .
4. In the pop up page user can select the file from the local machine and
click on button.
Action to be performed between two page:
when the user selects the file from the location machine in the pop up
window, close the window and redirect to the parent window and place the
name of the file selected by the user in file filed (This will be hide) in
the parent window.the multipart request will be passed from the parent to
nect page  to check in a file. 

Problem:
I read the document that the IE 4/5 can't set the value to the file fileld
as the file filed is read only in IE 

I have written the below code

<script>
function checking()
{
	window.close();
	fileName('document.checkinForm.file.value)  // this method is in
parent window..
This doesn't set the value in the file filed in parent window..
}

</script>

<body MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0">
<form name="checkinForm" method="POST" enctype="multipart/form-data">
<input type="hidden" name="append" value="true">
<input type="hidden" name="unlock" value="true">
<input type="hidden" name="format">


<table align="center" border="0">
<tr height="60%">
	<td align="center" valign="middle">

	 <font size="3"  color="blue" face="arial"> <b>Click here to check
in a file</font>
	</td>
</tr>


<tr>
	<td>
		<input type ="file" name ="file">
	</td>
</tr>
<tr>
	<td align="center">
	<input type="submit" name="click" value="submit"
onClick="checkin();">
	</td>
</tr>

<TR><TD id=mesg></TD></TR>
</table>

</form> 


Can any one help me or suggest me?

Thanks
Murugan





"THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
ADDRESSEE and may contain confidential and privileged information.
If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this 
communication is strictly Prohibited. 
If you have received this message by error, please notify us 
immediately, return the original mail to the sender and delete the 
message from your system."




More information about the Javascript mailing list