← All changes
|
includes/Frontend/Form/View/Theme/Fields/TextField.php
+14
-0
2.10.2
→
2.15.3
View file →
| @@ -33,8 +33,10 @@ | ||
| 33 | 33 | $list = ''; |
| 34 | 34 | $bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds; |
| 35 | 35 | $contentCount = count($bfFrontendFormIds); |
| 36 | 36 | |
| 37 | + $onClickAttr = self::onClickAttr($field, $rowID); | |
| 38 | + | |
| 37 | 39 | if (property_exists($field, 'suggestions') && count($field->suggestions) > 0) { |
| 38 | 40 | $list = "list='{$rowID}-{$contentCount}-datalist'"; |
| 39 | 41 | $sugg .= "<datalist id='{$rowID}-{$contentCount}-datalist'>"; |
| 40 | 42 | foreach ($field->suggestions as $suggestion) { |
| @@ -76,8 +78,9 @@ | ||
| 76 | 78 | {$ac} |
| 77 | 79 | {$inputMode} |
| 78 | 80 | {$name} |
| 79 | 81 | {$value} |
| 82 | + {$onClickAttr} | |
| 80 | 83 | /> |
| 81 | 84 | {$prefixIcn} |
| 82 | 85 | {$suffixIcn} |
| 83 | 86 | </div> |
| @@ -82,6 +85,17 @@ | ||
| 82 | 85 | {$suffixIcn} |
| 83 | 86 | </div> |
| 84 | 87 | {$sugg} |
| 85 | 88 | TEXTFIELD; |
| 89 | + } | |
| 90 | + | |
| 91 | + private static function onClickAttr($field, $rowID) | |
| 92 | + { | |
| 93 | + $onClickAttr = ''; | |
| 94 | + $dateType = ['date', 'datetime-local', 'month', 'time', 'week']; | |
| 95 | + //field type check | |
| 96 | + if (in_array($field->typ, $dateType)) { | |
| 97 | + $onClickAttr = "onclick='this.showPicker();'"; | |
| 98 | + } | |
| 99 | + return $onClickAttr; | |
| 86 | 100 | } |
| 87 | 101 | } |