views:

53

answers:

1

I need to have an onclick/hover event on an input tag which is disabled.
Is there another way but to wrap it in another tag and give that tag the events?

<input type="checkbox" onclick="cant_choose('event')" disabled="disabled" value="2" name="enroll_to[event][]">
+3  A: 

You could simulate it being disabled with JavaScript and CSS.

That is, blur all focus it receives, and add a class with something like so.

  input.disabled {
    background: #d4d0c8;
    color: #888;
    cursor: default;
  }

Update

See it in comparison with the normal and browser disabled input box on JSbin.

alex
Yup - probably the only way.
Pekka