Click here to Skip to main content
15,889,335 members
Articles / Programming Languages / Javascript
Tip/Trick

OnClick of disabled textbox raise event

Rate me:
Please Sign up or sign in to vote.
2.00/5 (3 votes)
28 Mar 2010CPOL 10.5K   1  
Put a div around the textbox and write handler in the div's onclick. function txt1OnClick(){ alert('Hello...
Put a div around the textbox and write handler in the div's onclick.
XML
<div onclick="txt1OnClick()">
    <input type="text" id="txt1" runat="server"  disabled="disabled" class="blacktxt"  style="width:300px" onclick="txt1OnClick()"/>
</div>

function txt1OnClick()
{
    alert('Hello world!');

}



This trick doesnot work in FF :(

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --