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 to the CF scene
    Join Date
    Sep 2006
    Location
    U.K
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Drop Down Messages

    Hello,
    I was looking at the following script from http://www.javascriptkit.com and came across a small problem.

    Script Reference: http://www.javascriptkit.com/script/...omessage.shtml

    It works fine, it's just that I would like to know how I can add more than one field to alter when a different item is selected from the drop down menu.
    For example;
    When you have "What is JavaScript?" selected, as well as displaying the definition; it displays in a separate text area an example of JavaScript.

    Then when you change the option to "What is DHTML?", both values in the text areas change accordingly.

    Any help on the issue is appreciated,
    Regards;
    Griff

  • #2
    New Coder
    Join Date
    Sep 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is a short example may help you out.

    PHP Code:
    <script language="javascript">
    text[0] = 'first text';
    text[1] = 'second text';
    text[2] = 'third text';
    text[3] = 'forth text';
    </script>
    <select onchange="document.getElementById('test').value = text[this.value];">
    <option value='0'>First
    <option value='1'>Second
    <option value='2'>Third
    <option value='3'>Forth
    </select>
    <div id="test"></div> 
    so happy, so cool

    http://coolersport.info


  •  

    Posting Permissions

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