a form style problem

G

Glenn T.

#1
I`m having problems trying to define the style of the (<input
type="file"...) browse button.
I've tryed everything, nothing seems to work.
when you define the css-style you only define the style of the text field
not the button, how do I specify the button.

#2
Tried to manipulate by using z-index hiding the (<input type="file"...)
behind everything, assigning an id to it, and accessing it with an anchor
(whit the style i wanted) that runs a javascript function
'document.getElementById('the_id').click();' than the open file dialog apeared
that worked but when submitting the form an error message pops up saying
"access denied."

please help me...
 
J

Jon Spivey

Hi Glenn,

You can't script the file upload button in any way - there's obvious
security reasons for this. You can style it to a limited extent though,
bearing in mind the button and the text field are classed as one object, so
you can't style the 2 seperately. For example see what happens when you do
this
<style>
..button{
border: 1px solid black;
background-color:yellow;
}
</style>
<input class="button" type="file"
 
G

Glenn T.

yeah..
That's as far as I've come..
(the background-color only aplyes to the textfield part thoug)..
thanx anyway.

I've tested it with other browsers and IE is probably the only browser that
accepts any change of that perticular button at all.. (the border).

So thanks anyway.
 
Top