I have a file button (for uploading an image).
I want to use an image to fire the 'file' selection. I have crated an image in a <label> tag and used 'for' to enable the <label> (and therefor the image) to fire the 'file' dialogue.
<label for = "userfile" style = "cursor: hand;cursor: pointer;">
<input style = "display:none;" name="userfile" id="userfile" type="file" />
The example shows my test code (apologies for the inline styling).
From my research there seems to be limitation with some browsers stopping the programmatic firing of a 'file' input, as this is deemed a potential security risk.
Does anyone have a solution that will allow me to get round this and allow the firing of a 'file' input when an image is clicked that will be cross browser compatible?