HTML PROBLEM
- Started
- Last post
- 15 Responses
- REDWOOD
Does anyone know how to replace the button of the form tag input type="file" by an image?
Its for a fileupload or maybe you know a diffrent way to achieve this.MERCIO DEL RIO
Redwood
- Vain0
i think this thread already happened today...
- quik0
like this.
I think thats what you mean?
- REDWOOD0
quik, you can't use tags in this forum they are parsed out.
- Nematoth0
<input type=image src="./path/to/image.jpg">
Dunno if you'll be able to view or not.. let's give it a go..
- Nematoth0
ok.. it worked..
Is that all u need?
Or you can do this:<form action="http://www.go.here.on.cl... method="get">
<button type="submit">
<img width="50" height="15" src="imageName.jpg">
</button>
</form>Just another option for ya..
- REDWOOD0
Nematoh, that wasn't the question, it's a litle more difficult than that.
it's about this tag this result in a button to browse you're pc for uploading a file and the button should be replaced by an image.
- ribit0
That was the question.
For a file upload you need to use a script... hotscripts.com or something..
- REDWOOD0
The script is not the problem, that works. It's a css problem. Does nobody understands me.
; )
It's just that the html form tag input type="file" an ugly button shows and i want to replace thisone with a custom image.Besides how can i show html tags in this forum?
MERCIO DEL RIO
- jevad0
input type="image" src="the path to your image"
not rocket science
- Nac0
view the source of this page, I think this is what you are asking for
- sparker0
he is asking how to change the button in the *input type="file"* element, specifically.
not how to use an image for a regular *input type="button"* element. folks.
and, to my knowledge you can't...because *input type="file"* is a particular component.
you would have to build a custom upload using a text file and a button element, distinct from eachother.
- mitsu0
this is a simple procedure. i do it all the time:
1.) create the file input tag and call it myfileinput
2.) set its display to none
3.) create your image tag
4.) put the following in the image tag: onclick='getfile();'
5.)in your script tags put the following:
function getfile(){
myfileinput.click();
}
6.) eat some pie.
- mitsu0
well, it appears that netscape doesn't capture the click event which means it's unlikely mozilla or safari would either, so it looks like you may, in fact, be sol.
- REDWOOD0
Yeah, so much thanxs to mitsu, you're the only one who did understand my problem and you've solved it. Man that's great now i'm happy. Much Thanx again. Mercio Del Rio