Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my textbox I have entered data as follows 'hai@1 '. I need to select 'hai@1 ' on double click. I have given 'onclick="this.select();"'. But on single click itself it is selecting. I need to select on double click.Please help ne to solve this.
Posted
Updated 31-Oct-12 18:23pm
v2
Comments
Vani Kulkarni 1-Nov-12 0:58am    
Is it really required to add an event to meet your requirement? I think it will work without writing any code. Just enter any value in textbox and double click it. It will be selected. I tried it on IE 8. Its working. Not sure about other browsers.
CSR89 1-Nov-12 1:14am    
Ya but when we enter any special charectoer selection is done for that special charectors only. not to entire text. Example: hai!@ Here when we double click !@ alone is selected instead of selecting whole text
AshishChaudha 1-Nov-12 1:22am    
agreed..
CSR89 1-Nov-12 1:50am    
How can i solve this???
CSR89 1-Nov-12 2:43am    
Please help me to solve this

1 solution

Hi,

Try this.

Add another attribute for textbox.

ondblclick="document.getElementById('test').select()"

Regards,
RK
 
Share this answer
 
Comments
CSR89 1-Nov-12 7:09am    
when we enter any special charectoer selection is done for that special charectors only. not to entire text. Example: hai!@ Here when we double click !@ alone is selected instead of selecting whole text..
THIS ISSUE EXISTS
Vipul J Patel 1-Nov-12 10:13am    
I have tried using the the "hai!@ as per above post and it's working fine please try it again..

Thanks,
Vipul Patel
3I InfoCom

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