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

    Post Generating a word or phrase based on drop-down menu ...?

    Hello!

    I've got a question... Does anyone here know/can find the code for generating a word (probably in a text area) based on what has been selected from a drop-down menu or radio buttons?

    An example would be here: http://www.neonuttersofneopia.com/petposer.php

    Except that generates images. I wonder if anyone could edit the coding to have it show a word depending on what's selected in the menus. Thanks.

    GG

  • #2
    New Coder
    Join Date
    Dec 2005
    Location
    Dallas, TX
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <div id="updated_text">
    Default text here.
    </div>
    <form name="selection_form">
    <select name="selection" onchange="update()">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </form>
    
    <script>
    
    function update() {
        document.getElementById("updated_text").innerHTML = "You changed the value to " + document.selection_form.selection.value + ".";
    }
    
    </script>
    If you plop that into an HTML file, and open it in your browser, you'd see that it does exactly what you want. =)

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Thank you

    Osiris -- thanks a TON. Now. I'm sorry for being so picky, and although I MIGHT be able to figure this out on my own (though it'd take days), I just have one small request...?

    I am trying to use this Javascript thing to generate specific kinds of words. Like, I want the word that appears to depend on these things:

    ~ Number of words, which I'm thinking could be selected out of radio buttons (or just regular buttons), which then generates a specific drop down list containing:
    ~ First letter of each word/phrase, which would use the code you gave me.

    Seriously, I can probably figure this out on my own. But not very quickly. Again, though, thanks SO MUCH because if I must find out how to do this on my own, then this gets me a super head start. You rock

    GG

    PS. Here is what I am trying to work on: http://www.freewebs.com/isketch-cs/animalseasytest.htm - I could still explain it if anyone needs an explanation
    Last edited by gg2112; 12-17-2005 at 01:00 AM.

  • #4
    New Coder
    Join Date
    Dec 2005
    Location
    Dallas, TX
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not quite sure I understand what you're asking... Could you try to be just a little more specific?


  •  

    Posting Permissions

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