Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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