forms - jQuery detect click on disabled submit button -
fiddle: http://jsfiddle.net/ugzux/
as can see, have form disabled (via javascript) submit button.
i want able bind click event anyway, can jazzy indication of needs fixed on input before i'll allow form submitted (i.e enable button again).
however, disabling submit button apparently disables click events bound button, if bound after disable - idea how around this?
practically, 1 solution stop disabling button , instead have event does
$('form').submit(function(event){ event.preventdefault(); });
however want know ins , outs of disabled inputs , javascript events, , if there workarounds i've never encountered behaviour before.
found in question -
firefox, , perhaps other browsers, disable dom events on form fields disabled. event starts @ disabled form field canceled , not propagate dom tree. correct me if i'm wrong, if click on disabled button, source of event disabled button , click event wiped out. browser literally doesn't know button got clicked, nor pass click event on. it's if clicking on black hole on web page.
i'd thought might able 'fake' click wrapping button in div , firing logic on div's click event. but, indicated above, events on disabled elements not seem bubbled dom tree.
Comments
Post a Comment