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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with form please

    Hello, i am making a form for a website in which i need to have the user fill in textfields and then have the text that is in the texfields appear in a textarea when a button is pressed.

    I havent been able to find any resources on what i want to do, i know how to write the code i need in visual basic but i do not know how to make the same thing happen in HTML or javascript.

    Any help would be appretiated thanks.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    u can try something like this
    Code:
    <form action="/">
    <input type="text" id="stuff" size="10">
    <input type="button" value="Send to text box" onclick="textstuff.value=stuff.value">
    </form>
    <textarea id="textstuff" rows=8 cols=30></textarea>

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thankyou i think thats exactly what i needed

  • #4
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    actually one more thing i could use (sorry for double post)

    onclick="textstuff.value=lastname.value+firstname.value"

    i have two text boxes, one for first name and one for last, anyway i can get the code to insert a comma between the two.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    try this then
    Code:
    <form action="/">
    <input type="text" id="lastname" size="10">
    <input type="text" id="firstname" size="10">
    <input type="hidden" value=", " id="comma">
    <input type="button" value="Send to text box" onclick="textstuff.value=lastname.value+comma.value+firstname.value">
    </form>
    <textarea id="textstuff" rows=8 cols=30></textarea>

  • #6
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah thanks alot again

  • #7
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    try this then
    Code:
    <form action="/">
    <input type="text" id="lastname" size="10">
    <input type="text" id="firstname" size="10">
    <input type="hidden" value=", " id="comma">
    <input type="button" value="Send to text box" onclick="textstuff.value=lastname.value+comma.value+firstname.value">
    </form>
    <textarea id="textstuff" rows=8 cols=30></textarea>
    Bleh? a hidden text field to add a comma?

    Use this:
    Code:
    <form action="/">
    <input type="text" id="lastname" size="10">
    <input type="text" id="firstname" size="10">
    <input type="button" value="Send to text box" onclick="textstuff.value=lastname.value + ',' + firstname.value;">
    <textarea id="textstuff" rows=8 cols=30></textarea>
    </form>

    I take no responsibility for the above nonsense.


    Left Justified

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts


  •  

    Posting Permissions

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