|
-
May 18th, 2012, 08:59 PM
#1
Thread Starter
Frenzied Member
[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
-
May 18th, 2012, 09:55 PM
#2
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,...
-
May 19th, 2012, 12:56 AM
#3
Thread Starter
Frenzied Member
Re: Select menus nad navigation
-
May 19th, 2012, 01:07 AM
#4
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:
<select name="gotoLinks" id="gotoLinks">
<option value="http://www.google.com?q=kerala">Kerala</option>
<option value="http://www.google.com?q=india">India</option>
<option value="http://www.google.com?q=us">US</option>
<option value="http://www.google.com?q=canada">Canada</option>
</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,...
-
May 19th, 2012, 01:20 AM
#5
Thread Starter
Frenzied Member
Re: Select menus nad navigation
thx, so i need the full url it seems?
-
May 19th, 2012, 01:38 AM
#6
Re: Select menus nad navigation
 Originally Posted by toecutter
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,...
-
May 19th, 2012, 01:44 AM
#7
Thread Starter
Frenzied Member
Re: Select menus nad navigation
excellent,thx
for some reason i am unable to rate you
-
May 19th, 2012, 05:02 AM
#8
Re: Select menus nad navigation
 Originally Posted by toecutter
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|