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

    Question Updating DOM Components

    Hey all - First post

    I've not done much in the way of JS, if really anything other than using javascript.com before, so this may be me bieng quite m00bish, but I am having problems with my script on a page.

    In a nutshell, the script I have currently allows my viewers to make a selection from a drop-down list, and as a result, the embedded WMP object below starts streaming the selected video.

    WMP gets the video name from the VALUE= element of each list item.

    My aim is that as well as the page starting the selected video, that a paragraph of text will appear under the WMP object based on the selection showing information regarding that video.

    I've tried playing with a VAR element, and then using document.write to print the variable name to the screen, but this only writes the value of the variable at the time of page loading, and does not refresh.

    My source code is actually live as a page viewable at http://www.nickypenn.plus.com/videos.html for anyone that's able to help me with this.

    Thanks very much.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    var text = new Array('text for selection 1','text for selection 2','text for selection 3');

    var selIndex = document.formName.selName.selectedIndex;
    var txtObj = document.getElementById('txtObj');
    txtObj.innerHTML = text[selIndex];

    <form name="formName">
    <select name="selName">
    <option ...>....</option>
    <option ...>....</option>
    <option ...>....</option>
    <option ...>....</option>
    <option ...>....</option>
    </select>
    </form>
    <div id='txtObj'></div>
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<

  • #3
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks very much.

    And will that code allow the DOM to update to display the paragraph of text related to the DIV Id selection?


  •  

    Posting Permissions

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