Add drop-down selector in header?

Oxygen general issues.
tomjohnson1492
Posts: 132
Joined: Thu Apr 17, 2014 1:55 am

Add drop-down selector in header?

Post by tomjohnson1492 »

I'd like to add a drop-down selector in the header.xhtml file that looks like this:

Code: Select all

  <form>
<select name="URL" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value">
<option value="">Choose a site</option>
<option value="http://example.com/java/index.html" target="_top">Java</option>
<option value="http://example.com/net/index.html" target="_parent">.NET</option>
<option value="http://example.com/cpp/index.html" target="_top">C++</option>
<option value="http://example.com/php/index.html" target="_parent">PHP</option>
</select>
</form>
This way users can jump quickly to other help files. However, since the webhelp is frame-based, the new URL loads inside a frame and doesn't actually change the page. How can I make it so that when users select another option, a different URL loads?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Add drop-down selector in header?

Post by sorin_ristache »

If you want to change the entire page you have to set the option value in the parent window:

Code: Select all


<form>
<select name="URL" onchange="window.parent.location.href=this.form.URL.options[this.form.URL.selectedIndex].value">
. . .
Regards,
Sorin

<oXygen/> XML Editor Support
tomjohnson1492
Posts: 132
Joined: Thu Apr 17, 2014 1:55 am

Re: Add drop-down selector in header?

Post by tomjohnson1492 »

sweet. i think that works. thanks!
Post Reply