diff --git a/dev/js/src/datepicker.js b/dev/js/src/datepicker.js
index 84243a9..0fd47dd 100644
--- a/dev/js/src/datepicker.js
+++ b/dev/js/src/datepicker.js
@@ -99,9 +99,6 @@
      */
     show : function (year, month) {
 
-      // Create text view
-      this.showText();
-
       var e = this._element = d.createElement('div');
       e.setAttribute('tabindex', 0);
       e.style.outline = 0;
@@ -123,64 +120,40 @@
       this._element.appendChild(this._monthHelper());
       this._element.appendChild(this._yearHelper());
       this._element.appendChild(this._dayHelper());
-      this._element.appendChild(this._closer());
+      this._element.appendChild(this._stringHelper());
 
       return this._element;
     },
 
-    showText : function () {
+    _stringHelper : function () {
 
       // Create element
-      this._elementText = document.createElement('div');
-      var et = this._elementText;
-      et.setAttribute('tabindex', 0);
-      et.style.outline = 0;
-      et.classList.add('value');
-
       // Add input field
-      this._input = et.appendChild(
-	document.createElement('input')
-      );
-      this._input.value = this.toString();
+      var input = document.createElement('input');
+      input.value = this.toString();
+      input.setAttribute('tabindex', 0);
 
-      // Add toggle button
-      var datepicker = et.appendChild(
-	document.createElement('div')
-      );
-
-      datepicker.onclick =
-	this.viewCalendar.bind(this);
-
-      datepicker.appendChild(
-	document.createTextNode('x')
-      );
-
-      // Check for enter
-      this._input.addEventListener(
-	'keypress',
+      input.addEventListener(
+	'keyup',
 	function (e) {
 	  if (e.keyCode == 13) {
-	    this.fromString(this._input.value);
-	    this.store();
+	    if (this.fromString(input.value))
+	      this.store();
+
 	    e.halt();
             return false;
+	  }
+	  else {
+	    if (this.fromString(input.value)) {
+	      this._updateYear();
+	      this._updateMonth();
+	      this._updateDay();
+	    };
 	  };
 	}.bind(this)
       );
 
-      /*
-      var that = this;
-      et.addEventListener(
-	'blur',
-	function (e) {
-	  that.fromString(input.value);
-
-	  // Better: Hide!
-	  this.parentNode.removeChild(this);
-	  e.halt();
-	}
-      );
-      */
+      return input;
     },
 
     /**
@@ -190,35 +163,6 @@
       return this._element;
     },
 
-    elementText : function () {
-      return this._elementText;
-    },
-
-    viewText : function () {
-
-      // Replace calendar view with text view
-      this._element.parentNode.replaceChild(
-	this._elementText,
-	this._element
-      );
-    },
-
-    viewCalendar : function () {
-      // Update calendar
-      this.fromString(this._input.value);
-
-      this._updateYear();
-      this._updateMonth();
-      this._updateDay();
-
-      // Replace calendar view with text view
-      this._elementText.parentNode.replaceChild(
-	this._element,
-	this._elementText
-      );
-    },
-
-
     /**
      * Get the current date in string format.
      */
@@ -383,6 +327,9 @@
 
     // Update the month helper view.
     _updateMonth : function () {
+      if (this._showMonth === undefined || this._showMonth > 12)
+	this._showMonth = 1;
+
       this._mElement.firstChild.data = loc.MONTH[this._showMonth-1];
       this._selectMonth();
     },
@@ -416,15 +363,6 @@
       return table;
     },
 
-    // Create the day (calendar) helper element.
-    _closer : function () {
-      var closer = d.createElement('span');
-      closer.classList.add('closer');
-      closer.appendChild(d.createTextNode('x'));
-      closer.onclick = this.viewText.bind(this);
-      return closer;
-    },
-
     _dayBody : function () {
       var showDate = new Date(
 	this._showYear,
@@ -522,16 +460,20 @@
     },
 
     fromString : function (v) {
-      if (v !== undefined) {
+      if (v === undefined)
+	return false;
 
-	var d = v.split('-', 3);
-	d[0] = parseInt(d[0]);
-	if (d[1]) d[1] = parseInt(d[1]);
-	if (d[2]) d[2] = parseInt(d[2]);
+      if (!KorAP._validDateRE.test(v))
+	return false;
 
-	// Select values
-	this.select(d[0], d[1], d[2]);
-      };
+      var d = v.split('-', 3);
+      d[0] = parseInt(d[0]);
+      if (d[1]) d[1] = parseInt(d[1]);
+      if (d[2]) d[2] = parseInt(d[2]);
+
+      // Select values
+      this.select(d[0], d[1], d[2]);
+      return true;
     }
   };
 });
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 72bdeee..f22f3b4 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -451,10 +451,15 @@
 	);
 
 	dpElem.focus();
+	/*
 	dpElem.addEventListener('blur', function (e) {
+	  e.halt();
+
 	  // Remove datepicker
+	  // TODO: If focus is not set to string input
 	  that._element.removeChild(this);
 	});
+	*/
       }
       else {
 	var regex = this.type() === 'regex' ? true : false;
