SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't Find Simple Effect

    OK... I just need a script that will change text on a page whenever a different category is selected out of a dropdown box..

    I have seen text change on a clickover, but can't find it with the dropdown box.

    Thanks for your help in advance

  2. #2
    SitePoint Evangelist pip's Avatar
    Join Date
    Jun 2001
    Location
    Cape Town, South Africa
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can create a DIV element with your text in it, then give the DIV element an ID. Add script to the onChange event of your drop down box, to change the inner HTML of the DIV element. This could be something like this:

    function changeText(text) {
    document.all['MyDiv'].innerHTML = text;
    }


    <SELECT onChange="changeText(this.value)">
    <OPTION VALUE="First Option">First Option</OPTION>
    <OPTION VALUE="Second Option">Second Option</OPTION>
    <OPTION VALUE="Third Option">Third Option</OPTION>
    <OPTION VALUE="Fourth Option">Fourth Option</OPTION>
    </SELECT>

    <DIV ID="MyDiv">This is the text</DIV>

    You might have to manipulate the script to work for other browsers. If you're having a problem with that, let me know.
    - Pip
    ---------------------------------------------------------------------------------
    Nothing takes the taste out of peanut butter quite like unrequited love.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    San Jose, California
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Another idea

    Maybe you could adapt this one to your needs.

    http://www.dynamicdrive.com/dynamici...geselector.htm


Bookmarks

Posting Permissions

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