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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    textbox to text onClick

    I have a text box. I need the user to be able to click a button, and have the contents of that text box, (user entered) to become standard text, with out submitting a form.

    Is this possible?
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    What do you mean by standard text?

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Like Glenn, I'm not sure exactly what you want. But something about your post amused me, so I interpretted it as this:
    Code:
    <script>
    function BeholdTheText(){
     var i=document.getElementById('userEntered');
     var t=document.createTextNode(i.value);
     var o=document.getElementById('standardText');
     o.appendChild(t); 
     o.appendChild(document.createElement('br'));
     i.value=i.defaultValue;
     } 
    </script>
    <input type='text' value='to become standard text' id='userEntered' style='width:200px'><input type='button' value='Eeek!' onclick='BeholdTheText()'><br>
    <div id='standardText'></div>


  •  

    Posting Permissions

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