Skip to content

Instantly share code, notes, and snippets.

@tsmango
Created April 29, 2012 15:42
Show Gist options
  • Select an option

  • Save tsmango/2551440 to your computer and use it in GitHub Desktop.

Select an option

Save tsmango/2551440 to your computer and use it in GitHub Desktop.
<select onchange="if(this.options[this.selectedIndex].value !=''){window.top.location.href=this.options[this.selectedIndex].value}">
<option value="">Select a Category...</option>
{% for c in store.categories %}
<option value="{{ c.url }}" {% if category and category.url == c.url %}selected="selected"{% endif %}>{{ c.name }}</option>
{% endfor %}
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment