+ Reply to Thread
Results 1 to 2 of 2

Thread: Getting text out of a textarea

  1. #1
    jakeselectronics is offline x10Hosting Member jakeselectronics is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    38

    Getting text out of a textarea

    Ok my generator is working...

    Take a look at the text area at teh bottom of the page.
    http://www.jakeselectronics.x10hosting.com/b.php

    I dont want the 1's and 0's in a textarea.... how can I get this to show in the normal line of text.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Getting text out of a textarea

    Quote Originally Posted by jakeselectronics View Post
    I dont want the 1's and 0's in a textarea.... how can I get this to show in the normal line of text.
    You mean an input/text field/form control? A textarea is a different form control than what you're using. To change the text in another kind of element, you can get a text node child of the element and assign to the text node's nodeValue property:

    HTML Code:
    <span id="display">0xDEADBEEF</span>
    <script type="text/javascript">
      display = document.getElementById("display");
      display.firstChild.nodeValue = '0xCAFEBABE';
    </script>
    Note that if #display were initially empty, the above wouldn't work because #display wouldn't have any text node children.

    An alternative is to leave the text input and style it so that it's indistinguishable from the surrounding text:
    HTML Code:
    <input id="display" value="10010110101000" size="14" />
    <style type="text/css">
    #display {
      background-color: transparent; /* may not work on some versions of IE */
      border-width: 0px;
    }
    </style>
    Last edited by misson; 10-21-2009 at 08:01 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. html/css help
    By swantonbomb88 in forum Programming Help
    Replies: 3
    Last Post: 05-01-2008, 09:12 AM
  3. BB Code Guide
    By Jober68 in forum Tutorials
    Replies: 1
    Last Post: 01-10-2008, 05:12 PM
  4. What is Authentication
    By asadislam78 in forum Computers & Technology
    Replies: 1
    Last Post: 12-13-2007, 07:13 AM
  5. |PS|*Blur text Tutorial*
    By |Born2Shoot| in forum Tutorials
    Replies: 7
    Last Post: 06-04-2005, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers