Click here to Skip to main content
15,912,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have written the following code and script. Its working in IE and in CHROME, but not Working in Mozilla.

JavaScript
function SelectAll(id) {
        window.setTimeout(function () {
            document.getElementById(id).select();
        }, 1);

My HTML code is as below

ASP.NET
<asp:TextBox ID="txtAddress" TextMode="MultiLine" onfocusin ="SelectAll(this.id);"  ondblclick="this.focus();this.select()" runat="server" TabIndex="6"  MaxLength="300"
               SkinID="textarea-small-style" ValidationGroup="requied"></asp:TextBox>


Please help me to find a solution for this. I'm a beginner.
Posted

1 solution

instead of "onfocusin", Please place "onfocus". let see the modified code below.

XML
<asp:TextBox ID="txtAddress" TextMode="MultiLine" onfocus ="SelectAll(this.id);"  ondblclick="this.focus();this.select()" runat="server" TabIndex="6"  MaxLength="300"
                SkinID="textarea-small-style" ValidationGroup="requied"></asp:TextBox>
 
Share this answer
 
Comments
CSR89 3-Nov-12 3:23am    
Thank you Sanjeev its working.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900