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
    Dec 2004
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Question Simple Text Box Problem

    Hi, i would like to simply create a text box for people to enter text in javascript. 400 by 80 pixels. There will be 14 buttons below it, 13 of them inserting a short word into the text box when each is clicked. The 14th needs to be a copy button which copies the entire text so it can be pasted. I am a very begginer but i have created this: The text box is not 400 pixels long, it is much longer. How can i make it 400 by 80 pixels? How do i make buttons which insert text into the box, like on this forum when you press the insert code tag button? I have made a second box for a number to be put in. Is it possible that when one of the buttons is pressed it could insert this number into the main text box?
    Thanks if anyone can help!

    <FORM NAME = advert creator>

    Advert: <INPUT TYPE = Text NAME = txtFirstNumber SIZE = 400 value ="">
    Number: <INPUT TYPE = Text NAME = txtFirstNumber SIZE = 5 value ="">
    <Input Type = Button NAME = b1 VALUE = "Copy Text" onClick = copytext()>

    </FORM>

  • #2
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post Not so simple, this text problem

    I don't think its all that simple however i'll refer you to two posts:
    Inserting data where the cursor is:
    Where the cursor is


    And for copying stuff to the clipboard check this:
    Copy to clipboard


  •  

    Posting Permissions

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