Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a file browse window in an HTA

Status
Not open for further replies.

norrisoft

Programmer
May 31, 2009
2
US
Hi All,

I have an HTA application from with in which I am trying to open a File Browse or File Upload window. I am doing so with the following code:

<input type="file" name="F2" size="20" onchange='somefunction();' style ='display: none;'>

Later I call:

window.form1.f2.click();

This works and opens the Choose File to Upload window but it sometimes causes the application to freeze.

In XP, if I alt+tab to another window and back the application unfreezes.

In Vista, alt+tab doesn't work but sometimes closing all of my other windows or opening and closing the task manager works.

Any ideas?

TIA
 
Have you tried it without hiding the input? If that works, then try another method to hide it, such as absolutely positioning the input -10000px to the left, etc.

Failing that, try removing the onchange and see what happens. If that works, then you could possibly use a timer to poll the value.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
BillyRay,

Is there a known issue with hidden file inputs causing the choose file dialog to freeze? I will try you suggestion.

Diancecht

To which file are your referring? My application or the file I'm trying to open? The file I'm trying to open is not an issue because the dialog freezes before I can click on one. My application is small but there is no need to upload all of the code here because I have included the relevant code above.

Thanks to both of you!

Steve
 
Is there a known issue with hidden file inputs causing the choose file dialog to freeze?

Not that I know of, but that would be the first thing I'd try, followed by removing the onchange.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top