Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    54
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Resizing text field with onfocus

    I am trying to get a text field to increase in size (one time to a predetermined size) when user clicks in the text field. Here is the code that for some reason isn't working for me.

    Code:
    <script type='text/javascript'>
           function resizeIt() 
            {
    	document.getElementById('comment').style.height = 50px;
            };
    </script>
    
    <input type='text' id='comment' class='urlTextArea' name='url' value=''
     size='75' onfocus='resizeIt()'>

  • #2
    New Coder
    Join Date
    Jun 2010
    Posts
    54
    Thanks
    4
    Thanked 0 Times in 0 Posts
    FIXED: I was missing quotes around '50px'.


  •  

    Posting Permissions

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