1 Reply Latest reply on Jan 16, 2014 10:25 AM by 8442

    Styling Country field drop downs

    Richard Wasylynchuk
      I'm wondering if there is an easy way to control the width and/or styling of drop down fields. We have our forms styled but the country fields aren't the same length as the other fields on the form. Is there an easy way to control this in Marketo or is this something we would have to do with our css?
        • Re: Styling Country field drop downs
          You can use a HTML block to define a custom CSS or jQuery to override the original CSS.


          jQuery: add a new class and then apply it to your inoput field:

               $(document).ready(function() {
                   $('input[type="text"]').addClass("idleField");
               $('input[type="text"]').focus(function() {
               $(this).removeClass("idleField").addClass("focusField");
                       if (this.value == this.defaultValue){
                       this.value = '';
                   }
                       if(this.value != this.defaultValue){
                   this.select();
                       }
                   });
                   $('input[type="text"]').blur(function() {
                   $(this).removeClass("focusField").addClass("idleField");
                       if ($.trim(this.value == '')){
                       this.value = (this.defaultValue ? this.defaultValue : '');
                   }
                   });
               });