Permalink
Browse files

Add placeholder support

1 parent bb411ad commit 63474995e8cff7b193d9db357edcfd31797b7341 @biehlermi biehlermi committed Apr 13, 2016
Showing with 5 additions and 2 deletions.
  1. +3 −0 dev/jquery.jtable.core.js
  2. +2 −2 dev/jquery.jtable.forms.js
@@ -138,6 +138,9 @@
if (props.inputClass == undefined) {
props.inputClass = '';
}
+ if (props.placeholder == undefined) {
+ props.placeholder = '';
+ }
//Convert dependsOn to array if it's a comma seperated lists
if (props.dependsOn && $.type(props.dependsOn) === 'string') {
@@ -129,7 +129,7 @@
/* Creates a standart textbox for a field.
*************************************************************************/
_createTextInputForField: function (field, fieldName, value) {
- var $input = $('<input class="' + field.inputClass + '" id="Edit-' + fieldName + '" type="text" name="' + fieldName + '"></input>');
+ var $input = $('<input class="' + field.inputClass + '" placeholder="' + field.placeholder + '" id="Edit-' + fieldName + '" type="text" name="' + fieldName + '"></input>');
if (value != undefined) {
$input.val(value);
}
@@ -142,7 +142,7 @@
/* Creates a password input for a field.
*************************************************************************/
_createPasswordInputForField: function (field, fieldName, value) {
- var $input = $('<input class="' + field.inputClass + '" id="Edit-' + fieldName + '" type="password" name="' + fieldName + '"></input>');
+ var $input = $('<input class="' + field.inputClass + '" placeholder="' + field.placeholder + '" id="Edit-' + fieldName + '" type="password" name="' + fieldName + '"></input>');
if (value != undefined) {
$input.val(value);
}

0 comments on commit 6347499

Please sign in to comment.