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.

            
              <div class="row">
  <div class="col-md-6 col-md-offset-3">
    <p class="desc">A proof of concept for using a chessboard FEN string as a login password.</p>
    <div class="well">
      <form id="form">
        <div class="form-group">
          <label for="un">Username / Email address</label>
          <input type="text" class="form-control" id="un" required>
        </div>

        <div class="form-group">
          <label id="pw-label" for="pw">Password</label>
          <input type="password" class="form-control" id="pw">
        </div>

        <button type="submit" class="btn btn-default">Login</button>
      </form>
    </div><!-- .well -->
  </div><!-- .col -->
</div><!-- .row -->
            
          
!
            
              /*!
 * chessboard.js $version$
 *
 * Copyright 2013 Chris Oakman
 * Released under the MIT license
 * https://github.com/oakmac/chessboardjs/blob/master/LICENSE
 *
 * Date: $date$
 */
.clearfix-7da63{clear:both}.board-b72b1{border:2px solid #404040;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.square-55d63{float:left;position:relative;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.white-1e1d7{background-color:#f0d9b5;color:#b58863}.black-3c85d{background-color:#b58863;color:#f0d9b5}.highlight1-32417,.highlight2-9c5d2{-webkit-box-shadow:inset 0 0 3px 3px #ff0;-moz-box-shadow:inset 0 0 3px 3px #ff0;box-shadow:inset 0 0 3px 3px #ff0}.notation-322f9{cursor:default;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;position:absolute}.alpha-d2270{bottom:1px;right:3px}.numeric-fc462{top:2px;left:2px}.desc{margin:2em 20px}

.offscreen {
  left: -999em;
  position: absolute;
}
            
          
!
            
              /*!
 * chessboard.js $version$
 *
 * Copyright 2013 Chris Oakman
 * Released under the MIT license
 * https://github.com/oakmac/chessboardjs/blob/master/LICENSE
 *
 * Date: $date$
 */
!function(){"use strict";function e(e){if("string"!=typeof e)return!1;var r=e.split("-");return 2!==r.length?!1:n(r[0])===!0&&n(r[1])===!0}function n(e){return"string"!=typeof e?!1:-1!==e.search(/^[a-h][1-8]$/)}function r(e){return"string"!=typeof e?!1:-1!==e.search(/^[bw][KQRNBP]$/)}function t(e){if("string"!=typeof e)return!1;e=e.replace(/ .+$/,"");var n=e.split("/");if(8!==n.length)return!1;for(var r=0;8>r;r++)if(""===n[r]||n[r].length>8||-1!==n[r].search(/[^kqrbnpKQRNBP1-8]/))return!1;return!0}function o(e){if("object"!=typeof e)return!1;for(var t in e)if(e.hasOwnProperty(t)===!0&&(n(t)!==!0||r(e[t])!==!0))return!1;return!0}function a(e){return e.toLowerCase()===e?"b"+e.toUpperCase():"w"+e.toUpperCase()}function i(e){var n=e.split("");return"w"===n[0]?n[1].toUpperCase():n[1].toLowerCase()}function s(e){if(t(e)!==!0)return!1;e=e.replace(/ .+$/,"");for(var n=e.split("/"),r={},o=8,i=0;8>i;i++){for(var s=n[i].split(""),p=0,f=0;f<s.length;f++)if(-1!==s[f].search(/[1-8]/)){var u=parseInt(s[f],10);p+=u}else{var d=c[p]+o;r[d]=a(s[f]),p++}o--}return r}function p(e){if(o(e)!==!0)return!1;for(var n="",r=8,t=0;8>t;t++){for(var a=0;8>a;a++){var s=c[a]+r;n+=e.hasOwnProperty(s)===!0?i(e[s]):"1"}7!==t&&(n+="/"),r--}return n=n.replace(/11111111/g,"8"),n=n.replace(/1111111/g,"7"),n=n.replace(/111111/g,"6"),n=n.replace(/11111/g,"5"),n=n.replace(/1111/g,"4"),n=n.replace(/111/g,"3"),n=n.replace(/11/g,"2")}var c="abcdefgh".split("");window.ChessBoard=window.ChessBoard||function(r,a){function i(){return"xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx".replace(/x/g,function(e){var n=16*Math.random()|0;return n.toString(16)})}function f(e){return JSON.parse(JSON.stringify(e))}function u(e){var n=e.split(".");return{major:parseInt(n[0],10),minor:parseInt(n[1],10),patch:parseInt(n[2],10)}}function d(e,n){e=u(e),n=u(n);var r=1e4*e.major*1e4+1e4*e.minor+e.patch,t=1e4*n.major*1e4+1e4*n.minor+n.patch;return r>=t}function h(e,n,r){if(a.hasOwnProperty("showErrors")===!0&&a.showErrors!==!1){var t="ChessBoard Error "+e+": "+n;return"console"===a.showErrors&&"object"==typeof console&&"function"==typeof console.log?(console.log(t),void(arguments.length>=2&&console.log(r))):"alert"===a.showErrors?(r&&(t+="\n\n"+JSON.stringify(r)),void window.alert(t)):void("function"==typeof a.showErrors&&a.showErrors(e,n,r))}}function l(){if("string"==typeof r){if(""===r)return window.alert("ChessBoard Error 1001: The first argument to ChessBoard() cannot be an empty string.\n\nExiting..."),!1;var e=document.getElementById(r);if(!e)return window.alert('ChessBoard Error 1002: Element with id "'+r+'" does not exist in the DOM.\n\nExiting...'),!1;se=$(e)}else if(se=$(r),1!==se.length)return window.alert("ChessBoard Error 1003: The first argument to ChessBoard() must be an ID or a single DOM node.\n\nExiting..."),!1;return window.JSON&&"function"==typeof JSON.stringify&&"function"==typeof JSON.parse?$.fn&&$.fn.jquery&&d($.fn.jquery,we)===!0?!0:(window.alert("ChessBoard Error 1005: Unable to find a valid version of jQuery. Please include jQuery "+we+" or higher on the page.\n\nExiting..."),!1):(window.alert("ChessBoard Error 1004: JSON does not exist. Please include a JSON polyfill.\n\nExiting..."),!1)}function v(e){return"fast"===e||"slow"===e?!0:parseInt(e,10)+""!=e+""?!1:e>=0}function g(){return("string"==typeof a||o(a)===!0)&&(a={position:a}),"black"!==a.orientation&&(a.orientation="white"),Se=a.orientation,a.showNotation!==!1&&(a.showNotation=!0),a.draggable!==!0&&(a.draggable=!1),"trash"!==a.dropOffBoard&&(a.dropOffBoard="snapback"),a.sparePieces!==!0&&(a.sparePieces=!1),a.sparePieces===!0&&(a.draggable=!0),(a.hasOwnProperty("pieceTheme")!==!0||"string"!=typeof a.pieceTheme&&"function"!=typeof a.pieceTheme)&&(a.pieceTheme="img/chesspieces/wikipedia/{piece}.png"),(a.hasOwnProperty("appearSpeed")!==!0||v(a.appearSpeed)!==!0)&&(a.appearSpeed=200),(a.hasOwnProperty("moveSpeed")!==!0||v(a.moveSpeed)!==!0)&&(a.moveSpeed=200),(a.hasOwnProperty("snapbackSpeed")!==!0||v(a.snapbackSpeed)!==!0)&&(a.snapbackSpeed=50),(a.hasOwnProperty("snapSpeed")!==!0||v(a.snapSpeed)!==!0)&&(a.snapSpeed=25),(a.hasOwnProperty("trashSpeed")!==!0||v(a.trashSpeed)!==!0)&&(a.trashSpeed=100),a.hasOwnProperty("position")===!0&&("start"===a.position?$e=f(ye):t(a.position)===!0?$e=s(a.position):o(a.position)===!0?$e=f(a.position):h(7263,"Invalid value passed to config.position.",a.position)),!0}function w(){var e=parseInt(se.width(),10);if(!e||0>=e)return 0;for(var n=e-1;n%8!==0&&n>0;)n--;return n/8}function m(){for(var e=0;e<c.length;e++)for(var n=1;8>=n;n++){var r=c[e]+n;ke[r]=r+"-"+i()}for(var t="KQRBNP".split(""),e=0;e<t.length;e++){var o="w"+t[e],a="b"+t[e];qe[o]=o+"-"+i(),qe[a]=a+"-"+i()}}function y(){var e='<div class="'+be.chessboard+'">';return a.sparePieces===!0&&(e+='<div class="'+be.sparePieces+" "+be.sparePiecesTop+'"></div>'),e+='<div class="'+be.board+'"></div>',a.sparePieces===!0&&(e+='<div class="'+be.sparePieces+" "+be.sparePiecesBottom+'"></div>'),e+="</div>"}function b(e){"black"!==e&&(e="white");var n="",r=f(c),t=8;"black"===e&&(r.reverse(),t=1);for(var o="white",i=0;8>i;i++){n+='<div class="'+be.row+'">';for(var s=0;8>s;s++){var p=r[s]+t;n+='<div class="'+be.square+" "+be[o]+" square-"+p+'" style="width: '+de+"px; height: "+de+'px" id="'+ke[p]+'" data-square="'+p+'">',a.showNotation===!0&&(("white"===e&&1===t||"black"===e&&8===t)&&(n+='<div class="'+be.notation+" "+be.alpha+'">'+r[s]+"</div>"),0===s&&(n+='<div class="'+be.notation+" "+be.numeric+'">'+t+"</div>")),n+="</div>",o="white"===o?"black":"white"}n+='<div class="'+be.clearfix+'"></div></div>',o="white"===o?"black":"white","white"===e?t--:t++}return n}function P(e){return"function"==typeof a.pieceTheme?a.pieceTheme(e):"string"==typeof a.pieceTheme?a.pieceTheme.replace(/{piece}/g,e):(h(8272,"Unable to build image source for cfg.pieceTheme."),"")}function O(e,n,r){var t='<img src="'+P(e)+'" ';return r&&"string"==typeof r&&(t+='id="'+r+'" '),t+='alt="" class="'+be.piece+'" data-piece="'+e+'" style="width: '+de+"px;height: "+de+"px;",n===!0&&(t+="display:none;"),t+='" />'}function x(e){var n=["wK","wQ","wR","wB","wN","wP"];"black"===e&&(n=["bK","bQ","bR","bB","bN","bP"]);for(var r="",t=0;t<n.length;t++)r+=O(n[t],!1,qe[n[t]]);return r}function S(e,n,r,t){var o=$("#"+ke[e]),s=o.offset(),p=$("#"+ke[n]),c=p.offset(),f=i();$("body").append(O(r,!0,f));var u=$("#"+f);u.css({display:"",position:"absolute",top:s.top,left:s.left}),o.find("."+be.piece).remove();var d=function(){p.append(O(r)),u.remove(),"function"==typeof t&&t()},h={duration:a.moveSpeed,complete:d};u.animate(c,h)}function E(e,n,r){var t=$("#"+qe[e]).offset(),o=$("#"+ke[n]),s=o.offset(),p=i();$("body").append(O(e,!0,p));var c=$("#"+p);c.css({display:"",position:"absolute",left:t.left,top:t.top});var f=function(){o.find("."+be.piece).remove(),o.append(O(e)),c.remove(),"function"==typeof r&&r()},u={duration:a.moveSpeed,complete:f};c.animate(s,u)}function q(e,n,r){function t(){o++,o===e.length&&(N(),Oe=!1,a.hasOwnProperty("onMoveEnd")===!0&&"function"==typeof a.onMoveEnd&&a.onMoveEnd(f(n),f(r)))}if(0!==e.length){Oe=!0;for(var o=0,i=0;i<e.length;i++)"clear"===e[i].type&&$("#"+ke[e[i].square]+" ."+be.piece).fadeOut(a.trashSpeed,t),"add"===e[i].type&&a.sparePieces!==!0&&$("#"+ke[e[i].square]).append(O(e[i].piece,!0)).find("."+be.piece).fadeIn(a.appearSpeed,t),"add"===e[i].type&&a.sparePieces===!0&&E(e[i].piece,e[i].square,t),"move"===e[i].type&&S(e[i].source,e[i].destination,e[i].piece,t)}}function k(e,n){e=e.split("");var r=c.indexOf(e[0])+1,t=parseInt(e[1],10);n=n.split("");var o=c.indexOf(n[0])+1,a=parseInt(n[1],10),i=Math.abs(r-o),s=Math.abs(t-a);return i>=s?i:s}function B(e){for(var n=[],r=0;8>r;r++)for(var t=0;8>t;t++){var o=c[r]+(t+1);e!==o&&n.push({square:o,distance:k(e,o)})}n.sort(function(e,n){return e.distance-n.distance});for(var a=[],r=0;r<n.length;r++)a.push(n[r].square);return a}function C(e,n,r){for(var t=B(r),o=0;o<t.length;o++){var a=t[o];if(e.hasOwnProperty(a)===!0&&e[a]===n)return a}return!1}function T(e,n){e=f(e),n=f(n);var r=[],t={};for(var o in n)n.hasOwnProperty(o)===!0&&e.hasOwnProperty(o)===!0&&e[o]===n[o]&&(delete e[o],delete n[o]);for(var o in n)if(n.hasOwnProperty(o)===!0){var a=C(e,n[o],o);a!==!1&&(r.push({type:"move",source:a,destination:o,piece:n[o]}),delete e[a],delete n[o],t[o]=!0)}for(var o in n)n.hasOwnProperty(o)===!0&&(r.push({type:"add",square:o,piece:n[o]}),delete n[o]);for(var o in e)e.hasOwnProperty(o)===!0&&t.hasOwnProperty(o)!==!0&&(r.push({type:"clear",square:o,piece:e[o]}),delete e[o]);return r}function N(){pe.find("."+be.piece).remove();for(var e in $e)$e.hasOwnProperty(e)===!0&&$("#"+ke[e]).append(O($e[e]))}function I(){pe.html(b(Se)),N(),a.sparePieces===!0&&("white"===Se?(fe.html(x("black")),ue.html(x("white"))):(fe.html(x("white")),ue.html(x("black"))))}function M(e,n){e=f(e);for(var r in n)if(n.hasOwnProperty(r)===!0&&e.hasOwnProperty(r)===!0){var t=e[r];delete e[r],e[n[r]]=t}return e}function D(e){var n=f($e),r=f(e),t=p(n),o=p(r);t!==o&&(a.hasOwnProperty("onChange")===!0&&"function"==typeof a.onChange&&a.onChange(n,r),$e=e)}function j(e,n){for(var r in ge)if(ge.hasOwnProperty(r)===!0){var t=ge[r];if(e>=t.left&&e<t.left+de&&n>=t.top&&n<t.top+de)return r}return"offboard"}function J(){ge={};for(var e in ke)ke.hasOwnProperty(e)===!0&&(ge[e]=$("#"+ke[e]).offset())}function Q(){pe.find("."+be.square).removeClass(be.highlight1+" "+be.highlight2)}function X(){function e(){N(),ce.css("display","none"),a.hasOwnProperty("onSnapbackEnd")===!0&&"function"==typeof a.onSnapbackEnd&&a.onSnapbackEnd(he,ve,f($e),Se)}if("spare"===ve)return void Y();Q();var n=$("#"+ke[ve]).offset(),r={duration:a.snapbackSpeed,complete:e};ce.animate(n,r),Ee=!1}function Y(){Q();var e=f($e);delete e[ve],D(e),N(),ce.fadeOut(a.trashSpeed),Ee=!1}function R(e){Q();var n=f($e);delete n[ve],n[e]=he,D(n);var r=$("#"+ke[e]).offset(),t=function(){N(),ce.css("display","none"),a.hasOwnProperty("onSnapEnd")===!0&&"function"==typeof a.onSnapEnd&&a.onSnapEnd(ve,e,he)},o={duration:a.snapSpeed,complete:t};ce.animate(r,o),Ee=!1}function K(e,n,r,t){("function"!=typeof a.onDragStart||a.onDragStart(e,n,f($e),Se)!==!1)&&(Ee=!0,he=n,ve=e,le="spare"===e?"offboard":e,J(),ce.attr("src",P(n)).css({display:"",position:"absolute",left:r-de/2,top:t-de/2}),"spare"!==e&&$("#"+ke[e]).addClass(be.highlight1).find("."+be.piece).css("display","none"))}function L(e,r){ce.css({left:e-de/2,top:r-de/2});var t=j(e,r);t!==le&&(n(le)===!0&&$("#"+ke[le]).removeClass(be.highlight2),n(t)===!0&&$("#"+ke[t]).addClass(be.highlight2),"function"==typeof a.onDragMove&&a.onDragMove(t,le,ve,he,f($e),Se),le=t)}function U(e){var r="drop";if("offboard"===e&&"snapback"===a.dropOffBoard&&(r="snapback"),"offboard"===e&&"trash"===a.dropOffBoard&&(r="trash"),a.hasOwnProperty("onDrop")===!0&&"function"==typeof a.onDrop){var t=f($e);"spare"===ve&&n(e)===!0&&(t[e]=he),n(ve)===!0&&"offboard"===e&&delete t[ve],n(ve)===!0&&n(e)===!0&&(delete t[ve],t[e]=he);var o=f($e),i=a.onDrop(ve,e,he,t,o,Se);("snapback"===i||"trash"===i)&&(r=i)}"snapback"===r?X():"trash"===r?Y():"drop"===r&&R(e)}function z(){return"ontouchstart"in document.documentElement}function A(){return navigator&&navigator.userAgent&&-1!==navigator.userAgent.search(/MSIE/)}function F(e){e.preventDefault()}function W(e){if(a.draggable===!0){var r=$(this).attr("data-square");n(r)===!0&&$e.hasOwnProperty(r)===!0&&K(r,$e[r],e.pageX,e.pageY)}}function G(e){if(a.draggable===!0){var r=$(this).attr("data-square");n(r)===!0&&$e.hasOwnProperty(r)===!0&&(e=e.originalEvent,K(r,$e[r],e.changedTouches[0].pageX,e.changedTouches[0].pageY))}}function H(e){if(a.sparePieces===!0){var n=$(this).attr("data-piece");K("spare",n,e.pageX,e.pageY)}}function V(e){if(a.sparePieces===!0){var n=$(this).attr("data-piece");e=e.originalEvent,K("spare",n,e.changedTouches[0].pageX,e.changedTouches[0].pageY)}}function Z(e){Ee===!0&&L(e.pageX,e.pageY)}function _(e){Ee===!0&&(e.preventDefault(),L(e.originalEvent.changedTouches[0].pageX,e.originalEvent.changedTouches[0].pageY))}function ee(e){if(Ee===!0){var n=j(e.pageX,e.pageY);U(n)}}function ne(e){if(Ee===!0){var n=j(e.originalEvent.changedTouches[0].pageX,e.originalEvent.changedTouches[0].pageY);U(n)}}function re(e){if(Ee===!1&&a.hasOwnProperty("onMouseoverSquare")===!0&&"function"==typeof a.onMouseoverSquare){var r=$(e.currentTarget).attr("data-square");if(n(r)===!0){var t=!1;$e.hasOwnProperty(r)===!0&&(t=$e[r]),a.onMouseoverSquare(r,t,f($e),Se)}}}function te(e){if(Ee===!1&&a.hasOwnProperty("onMouseoutSquare")===!0&&"function"==typeof a.onMouseoutSquare){var r=$(e.currentTarget).attr("data-square");if(n(r)===!0){var t=!1;$e.hasOwnProperty(r)===!0&&(t=$e[r]),a.onMouseoutSquare(r,t,f($e),Se)}}}function oe(){$("body").on("mousedown mousemove","."+be.piece,F),pe.on("mousedown","."+be.square,W),se.on("mousedown","."+be.sparePieces+" ."+be.piece,H),pe.on("mouseenter","."+be.square,re).on("mouseleave","."+be.square,te),A()===!0?(document.ondragstart=function(){return!1},$("body").on("mousemove",Z).on("mouseup",ee)):$(window).on("mousemove",Z).on("mouseup",ee),z()===!0&&(pe.on("touchstart","."+be.square,G),se.on("touchstart","."+be.sparePieces+" ."+be.piece,V),$(window).on("touchmove",_).on("touchend",ne))}function ae(){m(),se.html(y()),pe=se.find("."+be.board),a.sparePieces===!0&&(fe=se.find("."+be.sparePiecesTop),ue=se.find("."+be.sparePiecesBottom));var e=i();$("body").append(O("wP",!0,e)),ce=$("#"+e),xe=parseInt(pe.css("borderLeftWidth"),10),Pe.resize()}function ie(){l()===!0&&g()===!0&&(ae(),oe())}a=a||{};var se,pe,ce,fe,ue,de,he,le,ve,ge,we="1.7.0",me="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR",ye=s(me),be={alpha:"alpha-d2270",black:"black-3c85d",board:"board-b72b1",chessboard:"chessboard-63f37",clearfix:"clearfix-7da63",highlight1:"highlight1-32417",highlight2:"highlight2-9c5d2",notation:"notation-322f9",numeric:"numeric-fc462",piece:"piece-417db",row:"row-5277c",sparePieces:"spare-pieces-7492f",sparePiecesBottom:"spare-pieces-bottom-ae20f",sparePiecesTop:"spare-pieces-top-4028b",square:"square-55d63",white:"white-1e1d7"},Pe={},Oe=!1,xe=2,Se="white",$e={},Ee=!1,qe={},ke={};return Pe.clear=function(e){Pe.position({},e)},Pe.destroy=function(){se.html(""),ce.remove(),se.unbind()},Pe.fen=function(){return Pe.position("fen")},Pe.flip=function(){return Pe.orientation("flip")},Pe.move=function(){if(0!==arguments.length){for(var n=!0,r={},t=0;t<arguments.length;t++)if(arguments[t]!==!1)if(e(arguments[t])===!0){var o=arguments[t].split("-");r[o[0]]=o[1]}else h(2826,"Invalid move passed to the move method.",arguments[t]);else n=!1;var a=M($e,r);return Pe.position(a,n),a}},Pe.orientation=function(e){return 0===arguments.length?Se:"white"===e||"black"===e?(Se=e,I(),Se):"flip"===e?(Se="white"===Se?"black":"white",I(),Se):void h(5482,"Invalid value passed to the orientation method.",e)},Pe.position=function(e,n){return 0===arguments.length?f($e):"string"==typeof e&&"fen"===e.toLowerCase()?p($e):(n!==!1&&(n=!0),"string"==typeof e&&"start"===e.toLowerCase()&&(e=f(ye)),t(e)===!0&&(e=s(e)),o(e)!==!0?void h(6482,"Invalid value passed to the position method.",e):void(n===!0?(q(T($e,e),$e,e),D(e)):(D(e),N())))},Pe.resize=function(){de=w(),pe.css("width",8*de+"px"),ce.css({height:de,width:de}),a.sparePieces===!0&&se.find("."+be.sparePieces).css("paddingLeft",de+xe+"px"),I()},Pe.start=function(e){Pe.position("start",e)},ie(),Pe},window.ChessBoard.fenToObj=s,window.ChessBoard.objToFen=p}();

// Hide password field
$('#pw, #pw-label').addClass('offscreen');

// Add chessboard
$('#pw').after('<div id="board" style="min-width: 280px; width:100%"></div>');

// Drop event
var onDrop = function(source, target, piece, newPos, oldPos, orientation) {
  // Update password field
  $('#pw').val(ChessBoard.objToFen(newPos));
};

// Init chessboard
var board = ChessBoard('board', {
  draggable: true,
  dropOffBoard: 'trash',
  onDrop: onDrop,
  sparePieces: true,
  pieceTheme: 'https://chessboardjs.com/img/chesspieces/wikipedia/{piece}.png'
});

// For demo ONLY block form submit and display password
$("#form").submit(function(event) {
  event.preventDefault();
  alert('Password: ' + $('#pw').val());
});
            
          
!
999px
Loading ..................

Console