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 Link to comment Share on other sites More sharing options...
amitamberker Posted May 25, 2012 Share Posted May 25, 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 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. Link to comment Share on other sites More sharing options...
Krewe Posted May 25, 2012 Share Posted May 25, 2012 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. Link to comment Share on other sites More sharing options...
Guest So Called Posted May 25, 2012 Share Posted May 25, 2012 never mind 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 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? 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 <head><body><img src='../../../wanp...'... onlick="getFilePathFromDialog();"/> <input type='text' id='filepath'...>... The part marked with RED should be 'onClick' and not 'onlick'. 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
Archived
This topic is now archived and is closed to further replies.