Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member MichaelRoe's Avatar
    Join Date
    May 2012
    Location
    Brisbane, Australia :D
    Posts
    12
    Member #
    31866
    Liked
    1 times
    Hey everyone, I'm officially posting my first web dev related topic :P

    Anyway, if the title of this topic doesn't make sense, here's an example - You know when you make a new topic here, and you're inserting the title of the new topic in the <input type="text"> to the right of "Title:", the text you're typing into that text input automatically appears as large gray text to the right of "Create Thread:"?

    Well, I wanted to do something the same as that for the website I'm working on. Do any of you know what scripting language that would require, and if so, could you provide an example of a code that could achieve the same effect as described in the above paragraph.

    And if it's not so much to ask, could you describe it a bit so it's easier for a beginner to understand?

    Thanks

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    This should do the trick:
    HTML Code:
    <h2>Create a thread: <span id="dynamic_title"></span></h2>
    <label for="title">Title</label>
    <input type="text" id="title"
        onkeyup="document.getElementById('dynamic_title').innerHTML  = this.value;" />

  4. #3
    Junior Member MichaelRoe's Avatar
    Join Date
    May 2012
    Location
    Brisbane, Australia :D
    Posts
    12
    Member #
    31866
    Liked
    1 times
    Quote Originally Posted by smoseley, post: 236895
    This should do the trick:
    HTML Code:
    <h2>Create a thread: <span id="dynamic_title"></span></h2>
    <label for="title">Title</label>
    <input type="text" id="title"
        onkeyup="document.getElementById('dynamic_title').innerHTML  = this.value;" />
    Thanks heaps!

    That worked exactly as I hoped!

    Thanks again!

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    You might want to look up jQuery and specifically the keyup event.

    http://api.jquery.com/keyup/

    Moseley's will work as well and it's good stuff too, but if you want to get a little more advanced with it you may want to look at using jQuery and shortening up your code.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Junior Member MichaelRoe's Avatar
    Join Date
    May 2012
    Location
    Brisbane, Australia :D
    Posts
    12
    Member #
    31866
    Liked
    1 times
    Quote Originally Posted by TheGAME1264, post: 236899
    You might want to look up jQuery and specifically the keyup event.

    http://api.jquery.com/keyup/

    Moseley's will work as well and it's good stuff too, but if you want to get a little more advanced with it you may want to look at using jQuery and shortening up your code.
    Thanks for the link

    I'll check it out


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:54 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com