Results 1 to 5 of 5

Thread: LostFocus Question !!

  1. #1

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58

    LostFocus Question !!

    Hello

    I'm trying to create in any language possible (Javascript I think).. the follow:

    A textarea that receives the data of a textbox when it loses the focus.

    Can anyone help?

    Thanks!

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    When the textbox loses focus, or when the textarea does?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Location
    Sweden, Sthlm
    Posts
    112
    hi!!

    This should do it..

    <textarea name="textarea"></textarea>

    <input type="text" onBlur="entertext();" name="txtTheText">
    <script>
    function entertext()
    {
    textarea.value = txtTheText.value
    }
    </script>

  4. #4

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58
    Originally posted by meteor

    <textarea name="textarea"></textarea>

    <input type="text" onBlur="entertext();" name="txtTheText">
    <script>
    function entertext()
    {
    textarea.value = txtTheText.value
    }
    </script>
    Indeed!! This is it! But instead of deleting the data that is already in the textarea.. I need it to be added to the data that I enter in the textbox. And.. by the way.. the data are numbers with two decimal places and aligned to the right.

    And.. of course.. thank you for your help!

  5. #5
    New Member
    Join Date
    Mar 2003
    Location
    Stafford (uni), UK
    Posts
    4

    <textarea name="textarea"></textarea>
    <input type="text" onBlur="entertext();" name="txtTheText">
    <script>
    function entertext()
    {
    num1 = parseFloat(textarea.value);
    num2 = parseFloat(txtTheText.value);
    textarea.value = num1 + num2;
    }
    </script>
    That should work.

Posting Permissions

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



Click Here to Expand Forum to Full Width