Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple (or not) drop-down list with links

Featured Replies

Hey guys,

 

I have a page on wordpress and I am trying to get a list that comes up with a number of different options. When you click on an option, I am wanting that list-item to be selected and the hyperlink attached to take the user to the desired page.

 

The current page is: http://lmhc.co.uk/squad-page/

 

The code in hdeaer.php:

 

<script LANGUAGE="javascript">

function OnChange(dropdown)
{
	var myindex  = dropdown.selectedIndex
	var SelValue = dropdown.options[myindex].value
	var baseURL  = <Some value based on SelValue>
	top.location.href = baseURL;

	return true;
}

</SCRIPT>

 

 

The code in the template page:

 

<select name=select1 onchange='OnChange(this.form.select1);'>
       <option value="http://www.google.com">google</option>
       <option value="http://www.apple.com">apple</option>
       <option value="http://www.yahoo.com">yahoo</option>
       </select>

 

 

I'm not very savvy when it comes to JavaScript so this may well be (and probably is) completely wrong.

 

I have tried to piece this all together from tutorials as I have never done this before ...it can't be this hard!

 

Many thanks for any help,

Ali

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.