title: JQuery Plugin - Passing options as object
body: <p>I built a custom Message Dialog Box JQuery plugin that works great. However, I am trying to allow users to set the options from input text fields (i.e. background color, font size, etc). I then create a object with all the options that are not empty, and pass to my plugin to $.extend with the default options.
  Cant get it to work! Any ideas?</p>
  
  <p>messageBox_settings is the class for the input fields to be used as options.</p>
  
  <p>The field 'id' = option name. </p>
  
  <p>I am looping through each field and checking for any that are not empty.</p>
  
  <p>The plugin works fine when manually defining individual options in the plugin function call.</p>
  
  <pre><code>$('button#show_messagebox').click(function(){
              var optionLabel = '';
              var optionValue = '';
              var optionsArr = {};
              $('.messageBox_settings').each(function(){
                  if($(this).val()!=""){
                      optionLabel = $(this).attr('id');
                      optionValue = $(this).val();
                      $.extend(optionsArr,{optionLabel:optionValue});
                  }
              });
              //optionsArr = {optionLabel:optionValue}; Just a test when passing one option
              $('.messageBox_test').messageBox(optionsArr);
  </code></pre>