When the 'subButton2' button is clicked, the 'uploadBtn'(display:none;) should also be clicked.
This functionality needs to work across different browsers:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_html_click
The code provided below works in chrome, opera, and firefox but encounters issues in safari:
var page = window.location.toString();
if(page.indexOf('register') !== -1){
var subButton2 = document.getElementById("subButton2");
subButton2.onclick = function () {
var uploadBtn = document.getElementById("fileBtnHide");
//THIS FAILS IN SAFARI IF uploadBtn style= display:none;
uploadBtn.click();
};
};
***Please provide javascript solutions only, no jquery
This code is currently live on:
The Photo button is responsible for triggering the second button.