From 3b114371d083b01ef0726b098e1ed769ead5cb6f Mon Sep 17 00:00:00 2001 From: David Jade Date: Sun, 29 Dec 2013 17:18:00 -0800 Subject: [PATCH] Only set placeholders when field has no data (fixes #317) --- core/modules/widgets/edit-text.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/edit-text.js b/core/modules/widgets/edit-text.js index b5ef11eb9..f890baac2 100644 --- a/core/modules/widgets/edit-text.js +++ b/core/modules/widgets/edit-text.js @@ -37,11 +37,12 @@ EditTextWidget.prototype.render = function(parent,nextSibling) { // Execute our logic this.execute(); // Create our element + var editInfo = this.getEditInfo(); var domNode = this.document.createElement(this.editTag); if(this.editType) { domNode.setAttribute("type",this.editType); } - if(this.editPlaceholder) { + if(editInfo.value === "" && this.editPlaceholder) { domNode.setAttribute("placeholder",this.editPlaceholder); } // Assign classes @@ -49,7 +50,6 @@ EditTextWidget.prototype.render = function(parent,nextSibling) { domNode.className = this.editClass; } // Set the text - var editInfo = this.getEditInfo(); if(this.editTag === "textarea") { domNode.appendChild(this.document.createTextNode(editInfo.value)); } else {