Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ASP Button requires two clicks to post back?
- <input id="fileUpload" runat="server" type="file" style="visibility:hidden;" />
- <img id="btnBrowse" alt="Choose an photo to upload..." src="images/browse.gif" />
- $("#btnBrowse").click(function () {
- $('input[type=file]').click();
- });
- function addLoadEvent(func) {
- var oldonload = window.onload;
- if (typeof window.onload != 'function') {
- window.onload = func;
- }
- else {
- window.onload = function () {
- if (oldonload) {
- oldonload();
- }
- func();
- }
- }
- }
- addLoadEvent(whatYouWantToInit);
- var whatYouWantToInit_count = 0;
- function whatYouWantToInit() {
- if (whatYouWantToInit_count) { return; } // Won't let this function execute twice.
- whatYouWantToInit_count++;
- if ($('yourButton') != null) {
- $('yourButton').onclick = yourButton_click; //the function you want your onclick event to fire.
- }
- }
Add Comment
Please, Sign In to add comment