Jukka said:
No, it is an example of turning something that works (to the extent that
file submission can work at present) into something that fails to work in
a wide range of situations (including all situations where JavaScript is
disabled, filtered out by a company firewall, not supported etc.).
To do that for the sake of coloring a button is undescribably foolish.
You raise a valid point... How about this approach.
The onclick event is processed without javascript, is this correct? So
how about positioning a div over the button, making it look any way the
OP likes, then clicking the browse button in the div onclick event?
<style type="text/css">
..uploadbox {
font-family: verdana, arial, sans-serif;
font-size: 100%;
color: #800000;
font-weight: normal;
border: #797979 1px solid;
background-color: #ffddbb; //tan
border-color: brown;
width: 292px;
height: 22px;
}
div {
position: absolute;
top: 16px;
left: 205px;
height: 16px;
width: 99px;
font-size: 90%;
background-color: brown;
color: white;
padding: 2px;
z-order: 100;
cursor: hand;
cursor: pointer;
font-weight: bold;
}
</style>
</head>
<body>
<input type="file" class="uploadbox">
<div onclick="fileselect.click();">Select a File...</div>
Mike