WordPress.org

Ready to get started?Download WordPress

Forums

Chosen for WordPress
is there a class to protect from chosen? (3 posts)

  1. acub
    Member
    Posted 2 years ago #

    i like chosen and i'm using it on a website.
    however, i've built a custom form and i'd like it to stay the way i've built it. i worked hard to make it as compact as possible and chosen messes up my styles a bit.

    is there a way to tell chosen not to chosenify certain forms? or maybe a class for the fields i don't want processed?

    thank you.

    http://wordpress.org/extend/plugins/chosen/

  2. maltco
    Member
    Posted 1 year ago #

    Did you find a solution to this problem? If so, could you share your solution?

  3. jeezyo
    Member
    Posted 1 year ago #

    I was just searching for a solution to this problem myself, and decided to just edit the file. This works, but obviously if youre going to update your plugin, you'll need to make the change again.

    1) Deactivate the plugin
    2) Go into the editor to edit the plugin. Find the file, wp-chosen.js. itll contain the line below.

    jQuery(document).ready(function($) { $('select:not(#mo-fonts)').chosen();});
    3) Modify the line to include a special div for your select dropdowns that you dont want Chosen on. So for example, if you added a class of .normal-select, the line would like:
    jQuery(document).ready(function($) { $('select:not(#mo-fonts, .normal-select)').chosen();});

    Make sure you actually add this class to your select field, however you are creating your form. If its an automated form, your select form may already have a unique class or ID you can put in there.

    Hope that helps somebody!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic