Jquery: input type=submit still submits even when disabled

Viewed 104

I have a submit button that I am trying to disable programmatically but for some reason, when I change the disabled attribute of the element, I can still click submit and the event code still fires.

As an example, I have the following element in my html:

<input name="reg_submit" id="reg_button" value="Buddy" class="reg_button reg_button_new crm_submit" type="submit">

and have the following in my script to disable it:

var k = jQuery.noConflict();
k('#reg_button').attr("disabled", true);

And when I print debug, the element is in fact disabled. Is my approach flawed?

1 Answers
Related