Results 1 to 2 of 2

Thread: How to find user has stopped the typing ..

  1. #1
    Join Date
    Oct 2008
    Posts
    40
    Thanks
    3
    Thanked 1 Time in 1 Post

    Smile How to find user has stopped the typing ..

    Hello ,

    Suppose User is typing in text. He will see the notification that he is typing. when user will stop the typing then he will see the notification that user has entered the text.

    like in gmail chatting we get the notification that user is typing and when user stops typing he gets the notification he has entered the text ..............

    Consider one text box and div will show notification .......
    How to do this using javascript .......................................


    Please tell me ..............................

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Might work:
    Code:
    <script type="text/javascript">
    window.onload=function()
    	{
    	document.getElementById('test').onkeypress=function()
    		{
    		var show=document.getElementById('test1');
    			show.firstChild.nodeValue='You are typing...';
    		}
    	document.getElementById('test').onkeyup=function()
    		{
    		var show=document.getElementById('test1');
    		setTimeout(function()
    			{
    				show.firstChild.nodeValue='You are no longer typing.';
    			},2000); // Listen for 2 seconds of silence
    		}
    	}
    </script>
    <h3 id="test1">You are not typing yet</h3>
    <textarea id="test">
    
    </textarea>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •