cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <h2>Widget Order form</h2>
<form id="signupform"  method="get" action="">
  <p>
    <label for='fullname'>Your Name:</label>
  <input type='text' name='fullname' />
  </p>
  <p>
   <label for='email'>Your Email:</label>
  <input type='text' name='email' />
  </p>  
  <p >
   <label for='color'>Widget Color:</label>
    <div class='groupwrap container'>
<label><input type='radio' name='color' value='green' />Green</label>
<label><input type='radio' name='color' value='blue' />Blue</label>
<label><input type='radio' name='color' value='yellow' />Yellow</label>
    </div>
  </p>  
  <p >
    <label for='features'>Widget Features:</label>
    <div class='groupwrap container'>
    <label><input type='checkbox' name='features[]' value='green' />Tweets</label>
    <label><input type='checkbox' name='features[]' value='barks' />Barks</label>
    <label><input type='checkbox' name='features[]' value='jumps' />Jumps</label>
    <label><input type='checkbox' name='features[]' value='yawns' />Yawns</label></div>
  </p>
  <p>
    <input type='submit' name='submit' value='Submit'/>
  </p>
</form>

  
            
          
!
            
              body
{
  font-family: Arial, Sans-serif;
  font-size:0.8em;
}
.error
{

font-family:verdana, Helvetica;
}
.groupwrap
{
  display:inline-block;
}

            
          
!
            
              $(function()
{
  //Initialize the tooltips
  $('#signupform :input').each(function()
  {
      var tipelement = getTipContainer(this);

      $(tipelement).tooltipster({
         trigger: 'custom', 
         onlyOne: false, 
         position: 'right',
         multiple:false,
         autoClose:false});

  });
  
  //Setup the validator
  $('#signupform').validate(
      {
        rules:
        {
          fullname:{required:true},
          email:{required:true,email:true},
          color:{ required:true },
          'features[]':{ required:true,minlength:2 }
        },
        messages:
        {
          'features[]':
          {
            required:"Please select features",
            minlength:"Please select at least {0} features"
          }
        },
        errorPlacement: function(error, element) 
        {
          var $element = $(element),
              tipelement=element,
              errtxt=$(error).text(),
              last_error='';
          
            tipelement = getTipContainer(element);
          
            last_error = $(tipelement).data('last_error');
            $(tipelement).data('last_error',errtxt);
            if(errtxt !=='' && errtxt != last_error)
              {
                $(tipelement).tooltipster('content', errtxt);
                $(tipelement).tooltipster('show');
              }
        },
        success: function (label, element) 
        {
            var tipelement = getTipContainer(element);
            $(tipelement).tooltipster('hide');
        }
      });
  
  //this function selects a container for 'group' elements like 
  //check box /radio groups
  function getTipContainer(element)
  {
    var tipelement = element;
    if ( $(element).is(":checkbox") || $(element).is(":radio") )
    {
       tipelement = $(element).parents('.container').get(0);
    }
    return tipelement;
  }
});
            
          
!
999px
Loading ..................

Console