SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery textarea onfocus blur

    Hi,

    I thought I found a solution yesterday but it looks to only work with the input fields

    Does anyone know how to make a "textarea" field display hidden text as it does here in this URL -
    Code:
    http://www.topdesignmag.com/demo/jquery-forms-1/demo.htm#example1)
    the 1st example. They use it on textarea fields and I changed the CSS, (added textarea) and it worked for a while but once i added a text counter it did not work even when I switched it back.

    Code:
    NOTE: my added code:
    
    $('form#review textarea').focus(function () {
        	$(this).next("small2").css('display', 'block');
        	$(this).css('background-color', '#f2ce84');
    	});
    	
    	$('form#review textarea').blur(function () {
        	$(this).next("small2").hide();
        	$(this).css('background-color', '#f2ce84');
    	});
    I at least get the BG to change color upon clicking inside the box but the dropdown does not display.

    UPDATE: I can now get it to work in Firefox but not IE for the textarea

  2. #2
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can delete this thread as it appears I found the answer. I just changed the small2 name to a div class different name and it works in both browsers.


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
  •