javascript - On binding the on() method page is attaching the events and go the next page -
my problem when try bind click event using jquery on(). doesn't go next page.
favorite color?this input required.$('#continue-bank-login-security-question-submit').off('click'); $('#continue-bank-login-security-question-submit').on('click',function(e){ e.preventdefault(); e.stoppropagation(); if ($('.tranfer--bank-security-question-inputs').val().length===0){ $('.transfer--form-row-error').show(); return false; } else { $('.transfer--form-row-error').hide(); return true; } });
this should work won't remove you're original button click processing:
var elem = $('#continue-bank-login-security-question-submit'); var searchbuttononclick = elem.get(0).onclick; elem.get(0).onclick = function() { var isvalid = false; var sessionkey = ''; if ($('.tranfer--bank-security-question-inputs').val().length===0){ $('.transfer--form-row-error').show(); return false; } else { $('.transfer--form-row-error').hide(); searchbuttononclick(); } };
Comments
Post a Comment