From 27921f290f4e8a975a76006537e917f91fd82772 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 7 Feb 2014 13:11:21 -0600
Subject: [PATCH] Add placeholder for typeahead lists

---
 include/class.dynamic_forms.php | 5 +++--
 include/class.forms.php         | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index c1bedad65..924ad0140 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -930,7 +930,7 @@ class SelectionField extends FormField {
             )),
             'prompt' => new TextboxField(array(
                 'id'=>2, 'label'=>'Prompt', 'required'=>false, 'default'=>'',
-                'hint'=>'Text shown in the drop-down select before a value is selected',
+                'hint'=>'Leading text shown before a value is selected',
                 'configuration'=>array('size'=>40, 'length'=>40),
             )),
         );
@@ -974,7 +974,8 @@ class SelectionWidget extends ChoicesWidget {
         <span style="display:inline-block">
         <input type="text" size="30" name="<?php echo $this->name; ?>"
             id="<?php echo $this->name; ?>" value="<?php echo $name; ?>"
-            autocomplete="off" />
+            placeholder="<?php echo $config['prompt'];
+            ?>" autocomplete="off" />
         <input type="hidden" name="<?php echo $this->name;
             ?>_id" id="<?php echo $this->name; ?>_id" value="<?php echo $value; ?>"/>
         <script type="text/javascript">
diff --git a/include/class.forms.php b/include/class.forms.php
index dd4d66239..ca4cf44a7 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -670,7 +670,7 @@ class ChoiceField extends FormField {
             )),
             'prompt' => new TextboxField(array(
                 'id'=>2, 'label'=>'Prompt', 'required'=>false, 'default'=>'',
-                'hint'=>'Text shown in the drop-down select before a value is selected',
+                'hint'=>'Leading text shown before a value is selected',
                 'configuration'=>array('size'=>40, 'length'=>40),
             )),
         );
@@ -871,7 +871,7 @@ class PriorityField extends ChoiceField {
         return array(
             'prompt' => new TextboxField(array(
                 'id'=>2, 'label'=>'Prompt', 'required'=>false, 'default'=>'',
-                'hint'=>'Text shown in the drop-down select before a value is selected',
+                'hint'=>'Leading text shown before a value is selected',
                 'configuration'=>array('size'=>40, 'length'=>40),
             )),
         );
-- 
GitLab