Results 1 to 8 of 8

Thread: [RESOLVED] Select menus nad navigation

  1. #1

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Resolved [RESOLVED] Select menus nad navigation

    Hi,

    Venturing into the world of web programming.

    i am trying to use a "Select menu" to navagate to a local html page after a selction has been made, i tried searching and came up with nothing.

    HTML Code:
      <label for="select-choice-0" class="select">Select Customer:</label>
      <select name="select-choice-0" id="select-choice-1">
        <option value=""><a href="details.html">bj builders</option>
        <option value="">walkers</option>
        <option value="">hogans building</option>
        <option value="">QLD Electrical</option>
      </select>
    this is the line i have been trying to get the page link to work in.
    HTML Code:
      <option value=""><a href="details.html">bj builders</option>
    thx
    -toe

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Select menus nad navigation

    You have forgot to close the anchor tag.

    That line should be like this:
    Code:
    <option value=""><a href="details.html">bj builders</a></option>

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: Select menus nad navigation

    hmm, that does nothing

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Select menus nad navigation

    oh! I didn't see that you were using a dropdown box. So, when you select an item, you want to open it's corresponding link. Isn't it ?

    Here's a sample piece of code:

    HTML:
    html Code:
    1. <select name="gotoLinks" id="gotoLinks">
    2.       <option value="http://www.google.com?q=kerala">Kerala</option>
    3.       <option value="http://www.google.com?q=india">India</option>
    4.       <option value="http://www.google.com?q=us">US</option>
    5.       <option value="http://www.google.com?q=canada">Canada</option>
    6.   </select>​
    jQuery code:
    Code:
    $(document).ready(function(){
        // when the user changes the combobox value
        $('#gotoLinks').change(function(){
          var toURL = $('#gotoLinks :selected').val(); // get the selected items URL
          alert(toURL); // display the selected item's URL
    
          window.location = toURL; // goto that URL. 
        });
        
    });​
    Here's the fiddle: http://jsfiddle.net/meNYe/


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: Select menus nad navigation

    thx, so i need the full url it seems?

  6. #6
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Select menus nad navigation

    Quote Originally Posted by toecutter View Post
    thx, so i need the full url it seems?
    Full URL needs to be passed to window.location.

    If you want to avoid inserting full urls, use a global var that points to your domain:
    Code:
    var myDomain = "http://www.google.com/"
    So, for the window.location, append it with the page selected from the select box:
    Code:
    window.location = myDomain + gotoURL; //where gotoURL contains "index.html"

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  7. #7

    Thread Starter
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: Select menus nad navigation

    excellent,thx

    for some reason i am unable to rate you

  8. #8
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Select menus nad navigation

    Quote Originally Posted by toecutter View Post
    excellent,thx

    for some reason i am unable to rate you



    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

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



Click Here to Expand Forum to Full Width