Javascript: disabled input field

Posted by vinhboy on Sunday, October 28th, 2007 in Internet.

This is true for jQuery, and maybe true for JavaScript in general.

If you have an input field that is disabled:

<input type="text" name="example" value="example" disabled="disabled">

You cannot attach / bind any events to it ( ie. onClick, onSumbit, etc.. ).

In order to work with those disabled fields, you have to make a separate trigger that is NOT disabled, to enable those fields before they are accessible.

If someone knows otherwise, please let me know.

One Comment

  1. __ak Says (January 16th, 2009):

    If you find another solution I’d like to know :)

Leave a Comment