My code not work
-
why my code not work?
<?php print wpbusdirman_post_list_categories(); ?> <script type="text/javascript"> var dropdown = document.getElementById("cat"); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > 0 ) { location.href = "<?php get_category_link('cat=?>"+dropdown.options[dropdown.selectedIndex].value+"<?php ') ?>"; } } dropdown.onchange = onCatChange; </script> </div>
that codes generates a select box
<<select name="cat" id="cat" class="postform"> <option class="level-0" value="14736">Jakarta Selatan (1)</option> <option class="level-0" value="14737">Jakarta Timur (1)</option> <option class="level-0" value="14726">Jakarta Utara (1)</option> </select>
can anyone help me?? i want to use wp dropdown category without using submit button
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘My code not work’ is closed to new replies.