Question

Possible Duplicate:
How to hide text field in Html File Upload

I'm setting up an AJAX image uploader that will allow a user to choose a file, preview it with AJAX, and then click a submit button to save their choice.

Due to the way my AJAX uploader works, it always says "no file chosen" even after the user has selected and is previewing an image. I don't want to hide the button in case the user wants to try again. I know I could use some javascript to toggle between a 'choose file' and a 'select another' button or something similar, but I'd prefer to just keep the original button so the user doesn't have to click a bunch of different buttons.

Edit: I thought my question would be obvious, I guess it was not since I'm getting close votes...

Was it helpful?

Solution

Assuming I understand your requirements, see this article. It's a JS fix, which I suppose won't be a problem as you're using AJAX already.

It allows you to style a file input, so with a bit of creativity, you should be able to hide the no file chosen text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top