65.9K
CodeProject is changing. Read more.
Home

OnClick of disabled textbox raise event

starIconstarIconemptyStarIconemptyStarIconemptyStarIcon

2.00/5 (3 votes)

Mar 25, 2010

CPOL
viewsIcon

10520

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.
<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 :(