Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Drop down navigation using DIFFERENT frames


  • Please log in to reply

#1
Jim Bell

Jim Bell

    Member

  • Member
  • PipPip
  • 16 posts
Can anybody help me.

What I need is a javascript drop down navigation box, simple enough. However, I need to assign different target frames to each of the links within the drop down box. Is this possible? If so how do I do it?

As I mainly program with ASP, I dont really know any Javascript - so go easy on me . All that I do know is this has a client-side solution.

Many Thanks in advance,
Jim
  • 0

Advertisements


#2
Chris Graham

Chris Graham

    New Member

  • Member
  • Pip
  • 3 posts
(untested)

<script>
function fixForm(ob)
{
   var bits=ob.value.split(';');
   ob.form.action=bits[0];
   ob.form.target=bits[1];
}
</script>
<form action="">
   <select name="whatever" onclick="java script: fixForm(this); this.form.submit();">
	  <option value="http://foo.com;frame_a">Site A</option>
	  <option value="http://blah.com;frame_a">Site B</option>
	  <option value="http://whatever.com;frame_c">Site C</option>
   </select>
</form>

Substitue/extend frame_X and URLs and titles as appropriate, obviously.

It doesn't meet accessibility requirements, so personally I would also add a button, but it's up to you.

EDIT: IPB foobared up my code box for security reasons so as to put a space between 'java' and 'script'. Should be a single word.

Edited by Chris Graham, 14 July 2006 - 01:47 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP