When uploading files on the WEB, the upload box is used:
<Input type = "file" id = "f" name = "f">
This is a very special object in IE (others are not tested.
If it is a value that you manually write or other objects are triggered by certain events
Due to security issues, the submitted form is often cleared, so the upload fails.
To put it simply, IE will upload the file to you unless you have clicked f on the upload box!
Even if you assign the onclick handle of f to an object, for example:
<Input type = "file" id = "f" name = "f">
<Input onclick = "f. click ()" value = "click">
After you click, the file selection dialog box will also pop up. Unfortunately, you are disappointed that you still cannot upload files!
What should we do?
Take a look at this section:
<BODY onmousemove = "f. style. pixelLeft = event. x-200; f. style. pixelTop = events. y-10;">
<Input type = "text"> <input type = "button" onmousemove = "">
<Input type = "file" id = "f" name = "f" style = "position: absolute;">
</BODY>
Click the mouse to see the effect?
Based on the above idea, we can get it under a button and it will be OK !!
<Style>
Input {}{ border: 1px solid green ;}
</Style>
<BODY>
<BR>
<Form method = "post" action = "" enctype = "multipart/form-data">
<Input type = "text" id = "txt" name = "txt">
& Nbsp; <input type = "button" onmousemove = "f. style. pixelLeft = event. x-60; f. style. pixelTop = this. offsetTop; "value =" select a file "size =" 30 ">
<Input type = "file" id = "f" name = "f" style = "position: absolute;" size = "1" onChange = "txt. value = this. value "> <BR>
<Input type = "submit">
</Form>
</BODY>
To achieve the Simulated effect, you must hide f, add an opaque alpha filter, and add the hidefocus attribute to hide the dotted line of f:
<Style>
Input {}{ border: 1px solid green ;}
</Style>
<BODY>
<BR>
<Form method = "post" action = "" enctype = "multipart/form-data">
<Input type = "text" id = "txt" name = "txt">
& Nbsp; <input type = "button" onmousemove = "f. style. pixelLeft = event. x-60; f. style. pixelTop = this. offsetTop; "value =" select file "size =" 30 "onclick =" f. click () ">
<Input type = "file" id = "f" onchange = "txt. value = this. value "name =" f "style =" position: absolute; filter: alpha (opacity = 0); "size =" 1 "hidefocus> <BR>
<Input type = "submit">
</Form>
</BODY>
You can see that the opacity = 0 is slightly larger.
OK. Now you can control their style and position...