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.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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.

+ add another resource


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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                Knockout+Bootstrap'ing the very nice <a href="" target="_blank">Signature Pad library</a> Thomas Bradley has provided

<form method="post" action="" class="form-horizontal sigPad" data-bind="submit: saveSig" style="width: 525px;">
  <a href="#" class="btn btn-default clearButton" style="display: block; max-width: 12em;" data-bind="click: clearSig">Clear Signature</a>
  <div class="table-responsive" style="margin-bottom: 1em;">
    <canvas class="pad" width="500" height="100" data-bind="canvasDataUrl: sigImageDataUrl, value: sigImageDataUrl"></canvas>
    <!-- nugget: value binding is only thing knockout-validation subscribes to -->

  <div class="text-center" style="margin-top: 1.5em;">
    <button type="submit" class="btn btn-success btn-lg" style="width: 75%; white-space: normal;">I accept the terms of this agreement &nbsp;<i class="fa fa-chevron-right"></i></button>



                .validationMessage {
  color: red;
.pad {
  display: block;
  border: 1px solid;
  cursor: crosshair;
  -ms-touch-action: none;
  -ms-touch-action: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;


                ko.bindingHandlers.canvasDataUrl = {
  init: function(element, valueAccessor) {
    $(element).mousedown(function(e) {
      valueAccessor()("1"); //dummy population just to quickly clear validation message
    $(element).mouseup(function(e) {
      valueAccessor()(element.toDataURL()); //this is what ultimately populates bound value
    //iphone events
    $(element).bind("touchstart", function(ev) {
    $(element).bind("touchend", function(ev) {
      valueAccessor()(element.toDataURL()); //this is what ultimately populates bound value

ko.validation.rules['required'].message = 'required';
  errorMessageClass: "validationMessage input-group-addon"

(function() {
  var self = {};

  self.clearSig = function() {
  self.sigImageDataUrl = ko.observable().extend({
    required: true

  self.saveSig = function() {
    var result =;
    if (result().length > 0) {

    //you take it from here...
    var sigImageAsBase64String = self.sigImageDataUrl();

  var sigpad = $(".sigPad").signaturePad({
    drawOnly: true,
    lineTop: 75,
    validateFields: false


  return self;