I have a hidden file upload as it looks really bad, I have displayed a nicer looking button and would like it to click the hidden file upload when its clicked.
function ClickUpload() {
$("#FileUpload").trigger('click');
}
<div id="MyUpload">
<span id="FileName">Choose File</span>
<input id="uploadButton" type="button" value="Upload" onclick="ClickUpload()">
</div>
<div id="hideUglyUpload">
<input type="file" name="FileUpload" id="FileUpload"/>
</div>
So far i can move into the function ClickUpload() but it just passes through the click without the file selection window popup.
triggerfunction is not user initiated so the browser might be blocking it..triggerhandler()you can check weather the click was triggered and if not, to display a normalinput type=file: api.jquery.com/triggerhandler