Title: Javascript error if not showing Post Type drop down select
Last modified: August 24, 2016

---

# Javascript error if not showing Post Type drop down select

 *  [James Krill](https://wordpress.org/support/users/jkrill/)
 * (@jkrill)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-if-not-showing-post-type-drop-down-select/)
 * You need to add a conditional around your javascript (around line 101 in widget.
   super_search.php) so that it checks to see if the select is present or not. Otherwise
   you get a JS error.
 * I fixed by wrapping the jquery code in a conditional like this:
 *     ```
       jQuery(document).ready(function ($) {
                       if ($('#super_searchform select#post-type-selector').length) {
                           $('#super_searchform select#post-type-selector').live('change', function(e) {
                               e.preventDefault();
                               if( $('#super_searchform input#s').val() != '' && $('#super_searchform select#post-type-selector').val() != '') {
                                   $('#super_searchform').submit();
                               } else {
                                   $('#super_searchform input#s').focus();
                               }
                           });
                       }
                   });
       ```
   
 * [https://wordpress.org/plugins/eps-super-search/](https://wordpress.org/plugins/eps-super-search/)

The topic ‘Javascript error if not showing Post Type drop down select’ is closed
to new replies.

 * ![](https://ps.w.org/eps-super-search/assets/icon-256x256.jpg?rev=1102860)
 * [Super Search - Custom Post Types](https://wordpress.org/plugins/eps-super-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/eps-super-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/eps-super-search/)
 * [Active Topics](https://wordpress.org/support/plugin/eps-super-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/eps-super-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/eps-super-search/reviews/)

## Tags

 * ["js error"](https://wordpress.org/support/topic-tag/js-error/)

 * 0 replies
 * 1 participant
 * Last reply from: [James Krill](https://wordpress.org/support/users/jkrill/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-if-not-showing-post-type-drop-down-select/)
 * Status: not resolved