Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / Javascript

OnClick of disabled textbox raise event

2.00/5 (3 votes)
28 Mar 2010CPOL 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)