View Single Post
Old 07-24-2012, 10:37 AM  
LouiseLloyd
SO FUCKING SCAMMED
 
LouiseLloyd's Avatar
 
Industry Role:
Join Date: Mar 2010
Location: UK
Posts: 1,383
Wordpress help please

I am wanting to create a category dropdown list outside of the widget area so added:

Code:
<?php wp_dropdown_categories( $args ); ?>
<script type="text/javascript">
/* <![CDATA[ */
	var dropdown = document.getElementById("cat");
	function onCatChange() {
		if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
			location.href = "http://mysite.com/?cat="+dropdown.options[dropdown.selectedIndex].value;
		}
	}
	dropdown.onchange = onCatChange;
/* ]]> */
</script>
Which works fine, but my question is how do I add a default "- Select Model -" option to the list?

Grateful of any help, thanks <3
__________________

Last edited by LouiseLloyd; 07-24-2012 at 10:46 AM..
LouiseLloyd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote