Click to See Complete Forum and Search --> : input type=file


alain
03-12-2008, 01:36 PM
Hi,

i use an input type=file to allow users to upload file to database.

I would like to know how can i setup the length of the field where will be written the file name ?
in fact, how can i set a particular design (length, color, font,..) for the field and the button, but separately ?

thanks a lot,

A.

ray326
03-13-2008, 08:04 PM
Give the input a class or an id and play around with styles applied through that selector (input.myfile e.g.). Primarily due to security concerns most of the control for that particular input is only available to the browser and I hear some of them render very strange things for that widget.

Mugzy
05-13-2008, 03:19 PM
I've been trying to figure out a way to style the beloved input type="file" but of all the hacks I've found only 1 seems to work and it has it's own set of problems (you can't see the test you type or select in the input field). I need a solution and any help would be greatly appreciated. At this point I don't care if the solution is combo of JavaScript and CSS or just 1 of the 2. My biggest problem is that I have to support a ton of browsers. PC: IE 7, IE 6, FireFox, Opera (latest) and Safari 3.x On the Mac I have to support Firefox and Safari 3. The best solution I've been able to find is on the following website:

http://www.quirksmode.org/dom/inputfile.html

Anyone that has perfected this method and or has a better solution, please post your reply.

Thanks everyone!

-Mugzy