Jump to content


Photo

using javascript for the browse button on a file form


  • Please log in to reply
2 replies to this topic

#1 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 31 March 2006 - 02:02 PM

Within a form when you use the input type "file" you get that common browse button that is as ugly as the submit buttons :). Seeing how you can use the <forminfo>.Submit(); and replace the submit with a hyperlink with beautiful CSS styles associated with it. Can you not do the same for the browse? Like completely hide it and replace it with a javascript line?



#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 March 2006 - 02:31 PM

Actually you can use css on a browse button you can not hide trhe browser button and use a custom made one to submit an upload. I think the syntax for styling a file control box is this:
input[type=file] {
    //css code is here
}


#3 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 31 March 2006 - 03:50 PM

[!--quoteo(post=360378:date=Mar 31 2006, 09:31 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 09:31 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Actually you can use css on a browse button you can not hide trhe browser button and use a custom made one to submit an upload. I think the syntax for styling a file control box is this:
input[type=file] {
    //css code is here
}
[/quote]

Great! thank you, i will try it out!

Edit: found this website: [a href=\"http://www.quirksmode.org/dom/inputfile.html\" target=\"_blank\"]http://www.quirksmode.org/dom/inputfile.html[/a] to preform this task, but it just doesn't seem worth it... incompatiblity starts at IE5... I'll just use the basic one...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users