1.
<input type=
"file"
id=
"inputFile"
name=
"inputFile"
style=
"display:none"
onchange=
"changeAgentContent()"
/>
<input type=
"text"
value=
""
disabled id=
"inputFileAgent"
/>
<input type=
"button"
onclick=
"document.getElementById('inputFile').click()"
value=
"Browse..."
/>
<script type=
"text/javascript"
>
function
changeAgentContent(){
document.getElementById(
"inputFileAgent"
).value = document.getElementById(
"inputFile"
).value;
}
</script>
|
2.
<form name="form1">
<input type="file" name="picpath" id="picpath" style="display:none;" onChange="document.form1.path.value=this.value">
<input name="path" readonly>
<input type="button" value="上传照片" οnclick="document.form1.picpath.click()">
</form>