Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Style on this... ?

Status
Not open for further replies.

MikeBarone

Programmer
Mar 1, 2001
354
US
Since we learned how to add style to radio buttons does anyone know how to affect the button for the file field?

Code:
<input type=&quot;file&quot; name=&quot;file_select&quot; size=&quot;20&quot;>

I want to change the style of this button. » » » » » »
Mike Barone
FREE and Pro CGI/Perl Scripts

FREE Scripts
 
I have found that it's all or nothing. I tried -

style=&quot;border: 1px solid black&quot;

and got a rather pretty result, on both[/b] halves, the button and the text field. Not sure if you can split them up, but certain rules affect one and not the other, fr'instance background-color only affected the text box.

Hmm. Will have a play.
 
Try the following and see if you like it..... I used the font in inches that may sound funny but it looks good.... {~_*} colors depend on your bgcolor :)

.button
{
font-size: 0.1in;
border-top: #9b9bff solid thin;
border-bottom: #9b9bff solid thin;
border-right: #9b9bff solid thin;
border-left: #9b9bff solid thin;
font-family: Verdana, Arial, Helvetica, sans-serif;
}

Have a good one
 
you can do it, and still grab the string of the file input field like so:

<input type=file id=&quot;browsebox&quot; style=&quot;display:none&quot;>
<input type=text readonly id=&quot;stringbox&quot;>
<button style=&quot;border:1px solid black;background-color:336699;color:white&quot; onclick=&quot;browsebox.click();stringbox.value=browsebox.value&quot;>
Browse</button>

This is a cheesy-hack-workaround and may not work for all cases. Also, it forces them to use the browse button only. IE only :) jared@eae.net -
 
Just thought I'd ask if anyone is getting the readonly attribute to work with radio buttons? Is this not possible?

Thanks,
John Axsom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top