No replies
spicy52
spicy52's picture
Offline
newbie
Last seen: 7 years 45 weeks ago
Timezone: GMT+8
Joined: 2012-04-10
Posts: 1
Points: 2

Hi,

I am trying to replace the usual browse button from . However, I also need to make sure that user do not need to press submit button. Hence I need to haveonchange=this.form.submit()

<style type="text/css" >
input.hide
{
position:absolute;
left:-137px
-moz-opacity:0;
filter:alpha(opacity:0);
opacity:0;
z-index:2;
}
input.seagreen
{
background-color:#C1FFC1;
width:80px;
height:20px;
font-size:10px;
z-index:1;
color:#000000;
font-weight:bold;
}
</style>
 
<input type=button class=seagreen id=pseudobutton value='Upload'>
<input type=file class=hide name=uploadedfile onchange=this.form.submit()>

The above code will result in the styling, but it will not open a browse window.

If I only use

<input type=file name=uploadedfile onchange=this.form.submit()>

It works perfectly.

Are there any way to do this? or are there anything missing?