@@ -8,9 +8,14 @@ The text input allows you to interact with a string:
8
8
use Botble\Base\Forms\Fields\TextField;
9
9
use Botble\Base\Forms\FieldOptions\TextFieldOption;
10
10
11
- ->add('name', TextField::class, TextFieldOption::make())
11
+ $this
12
+ ->add('name', TextField::class, TextFieldOption::make());
12
13
```
13
14
15
+ Result:
16
+
17
+ ![ Text Field] ( ./images/form-text.png )
18
+
14
19
## Methods
15
20
16
21
``` php
39
44
);
40
45
```
41
46
47
+ ::: info
48
+ The same as other input fields, you can use the same methods as the text field.
49
+ :::
50
+
51
+
42
52
## Textarea Field
43
53
44
54
``` php
@@ -48,6 +58,10 @@ use Botble\Base\Forms\FieldOptions\TextareaFieldOption;
48
58
$this->add('description', TextareaField::class, TextareaFieldOption::make());
49
59
```
50
60
61
+ Result:
62
+
63
+ ![ Textarea Field] ( ./images/form-textarea.png )
64
+
51
65
## Number Field
52
66
53
67
``` php
@@ -57,17 +71,95 @@ use Botble\Base\Forms\FieldOptions\NumberFieldOption;
57
71
$this->add('limit', NumberField::class, NumberFieldOption::make());
58
72
```
59
73
74
+ Result:
75
+
76
+ ![ Number Field] ( ./images/form-number.png )
77
+
78
+ ## Number field with jQuery input mask
79
+
80
+ ``` php
81
+ use Botble\Base\Facades\Assets;
82
+ use Botble\Base\Forms\Fields\TextField;
83
+ use Botble\Member\Forms\Fronts\Auth\FieldOptions\TextFieldOption;
84
+
85
+ public function setup(): void
86
+ {
87
+ Assets::addScripts(['input-mask']); // add jQuery input mask
88
+
89
+ $this->add(
90
+ 'price',
91
+ TextField::class, // Must be a text field, not number field
92
+ TextFieldOption::make()
93
+ ->addAttribute('class', 'form-control input-mask-number')
94
+ );
95
+ }
96
+ ```
97
+
98
+ Result:
99
+
100
+ ![ Input mask number Field] ( ./images/form-input-mask-number.png )
101
+
60
102
## Password Field
61
103
62
104
``` php
63
105
use Botble\Base\Forms\Fields\PasswordField;
64
- use Botble\Base\Forms\FieldOptions\PasswordFieldOption ;
106
+ use Botble\Base\Forms\FieldOptions\TextFieldOption ;
65
107
66
- $this->add('password', PasswordField::class, PasswordFieldOption ::make());
108
+ $this->add('password', PasswordField::class, TextFieldOption ::make());
67
109
```
68
110
69
- ::: info
70
- The same as other input fields, you can use the same methods as the text field.
71
- :::
111
+ Result:
112
+
113
+ ![ Password Field] ( ./images/form-password.png )
114
+
115
+ ## Color Field
116
+
117
+ ``` php
118
+ use Botble\Base\Forms\Fields\ColorField;
119
+ use Botble\Base\Forms\FieldOptions\ColorFieldOption;
120
+
121
+ $this->add('color', ColorField::class, ColorFieldOption::make());
122
+ ```
123
+
124
+ Result:
125
+
126
+ ![ Color Field] ( ./images/form-color.png )
127
+
128
+ ## Time Field
129
+
130
+ ``` php
131
+ use Botble\Base\Forms\Fields\TimeField;
132
+ use Botble\Base\Forms\FieldOptions\TextFieldOption;
133
+
134
+ $this->add('time', TimeField::class, TextFieldOption::make());
135
+ ```
136
+
137
+ Result:
138
+
139
+ ![ Time Field] ( ./images/form-time.png )
140
+
141
+ ## Time field with jquery time picker
142
+
143
+ ``` php
144
+ use Botble\Base\Forms\Fields\TimePickerField;
145
+ use Botble\Base\Forms\FieldOptions\TextFieldOption;
146
+
147
+ $this->add('time', TimePickerField::class, TextFieldOption::make());
148
+ ```
149
+
150
+ Result:
151
+
152
+ ![ Timepicker Field] ( ./images/form-time-picker.png )
153
+
154
+ ## Date picker field
155
+
156
+ ``` php
157
+ use Botble\Base\Forms\Fields\DatePickerField;
158
+ use Botble\Base\Forms\FieldOptions\DatePickerFieldOption;
159
+
160
+ $this->add('date', DatePickerField::class, DatePickerFieldOption::make());
161
+ ```
162
+
163
+ Result:
72
164
73
- ...
165
+ ![ Datepicker Field ] ( ./images/form-date-picker.png )
0 commit comments