• GoDaddy Community
  • Websites + Marketing | Website Builders
  • Websites + Marketing | Website Builders

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Highlighted

    Multiple selection criteria/dropdowns to links

     

    Hi Folks!

    Still new here and just getting started with webpages after some false-starts.

     

    This case has me stumped. I need to have 2 drop down selections - the user picks 1 from each - and then a submit button to match those 2 results to a certain youtube video.

     

    For example:
    The first dropdown could have "Mom", and "Dad", and the second could have "kid1" and "kid2" - each combo would link to a different video after clicking the submit button (that would have those 2 people in it). I can't figure out how to essentially have a series of if/then statements based on the dropdown selections.

     

    so like
    if var1=Mom and var2=kid1 then url=whatever
    if var1=Mom and var2=kid2 then url=whatever2

    etc.

    I was pointed to this answer awhile ago but it doesn't seem to quite jive.

    any help would be super-appreciated!


    skiller

     


     


    <html>
    <head>
    <title>Youtube playlist search</title>
    </head>

    <body>

    <script type="text/javascript">

    function go_get(){
     var base_url = 'http://www.youtube.com/embed?listType=search&list=';
     var search_field = document.getElementById('yourtextfield').value;
     var target_url = base_url + search_field;
     var ifr = document.getElementById('youriframe');
     ifr.src=target_url;
     return false;
    }

    </script>

    <form onsubmit="go_get(); return false;" >
     <input type="text"  id="yourtextfield"/>
     <input type="submit" value="Search Playlists" />
    </form>

    <iframe id="youriframe" width="640" height="360" ></iframe>

    </body>
    </html>