beennn Posted May 24, 2012 Share Posted May 24, 2012 I've been looking about and cant seem to find how to have an image as a file uploader instead of the default choose file button <input type="file" /> any help would be great 1 Link to comment Share on other sites More sharing options...
amitamberker Posted May 25, 2012 Share Posted May 25, 2012 (edited) I've been looking about and cant seem to find how to have an image as a file uploader instead of the default choose file button <input type="file" /> any help would be great Hi beennn, Greetings to you Mate It should be as: <input type="image" name="Submit" value="Submit" src="images/File-Upload.png" /> By the way, please visit the following link: http://w3schools.inv...showtopic=43240 and let me know if you would be interested to Join Me to start-up that Venture. Edited May 25, 2012 by creative1977 Link to comment Share on other sites More sharing options...
Krewe Posted May 25, 2012 Share Posted May 25, 2012 (edited) Hi beennn, Greetings to you Mate It should be as: <input type="image" name="Submit" value="Submit" src="images/File-Upload.png" /> By the way, please visit the following link: http://w3schools.inv...showtopic=43240 and let me know if you would be interested to Join Me to start-up that Venture. That makes the submit button an image, not the "Chose File" button.As for making the Choose File button an Img... I dont know. I haven't even figured out how to change the text Choose File to something else. Edited May 25, 2012 by Krewe Link to comment Share on other sites More sharing options...
Guest So Called Posted May 25, 2012 Share Posted May 25, 2012 (edited) never mind Edited May 25, 2012 by So Called Link to comment Share on other sites More sharing options...
beennn Posted May 25, 2012 Author Share Posted May 25, 2012 still clueless I've found this using javascript: http://stackoverflow.com/questions/1377888/choose-file-box-by-clicking-on-image-not-with-browse-button doesn't seem to work though, or I'm doing something wrong by the looks of the likes Link to comment Share on other sites More sharing options...
eTianbun Posted May 25, 2012 Share Posted May 25, 2012 (edited) still clueless I've found this using javascript: http://stackoverflow.com/questions/1377888/choose-file-box-by-clicking-on-image-not-with-browse-button doesn't seem to work though, or I'm doing something wrong by the looks of the likes That should work though! Why not paste your code here, and lets see if you are missing something? Edited May 25, 2012 by CodeName Link to comment Share on other sites More sharing options...
beennn Posted May 25, 2012 Author Share Posted May 25, 2012 <html><head><script language="javascript">function getFilePathFromDialog() { document.getElementById('fileBrowser').click(); document.getElementById('filePath').value = document.getElementById('fileBrowser').value;}</script></head><body><img src="../../../wamp/www/images/browse_button.png" onlick="getFilePathFromDialog();"><input type="text" id="filePath" name="filePath" /><br /><input type="file" id="fileBrowser" name="fileBrowser" style="visibility:hidden; display:none;" /></body></html> Link to comment Share on other sites More sharing options...
eTianbun Posted May 25, 2012 Share Posted May 25, 2012 (edited) <head><body><img src='../../../wanp...'... onlick="getFilePathFromDialog();"/> <input type='text' id='filepath'...>... The part marked with RED should be 'onClick' and not 'onlick'. Edited May 25, 2012 by CodeName Link to comment Share on other sites More sharing options...
beennn Posted May 25, 2012 Author Share Posted May 25, 2012 Thank you! no idea how I missed that. Link to comment Share on other sites More sharing options...
eTianbun Posted May 25, 2012 Share Posted May 25, 2012 Thank you! no idea how I missed that. The error is from where you copied the code from! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now