Skip to content

Commit 3ec872f

Browse files
committed
feat(form components): polish and finalize native form submit + docs
1 parent 06fc6ab commit 3ec872f

File tree

21 files changed

+101
-54
lines changed

21 files changed

+101
-54
lines changed

docs/src/examples/QColor/NativeForm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<q-color
88
name="accent_color"
99
v-model="color"
10+
style="width: 200px; max-width: 100%;"
1011
/>
1112

1213
<div>

docs/src/examples/QFile/NativeForm.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
<q-file
88
name="poster_file"
99
v-model="file"
10+
filled
1011
label="Select poster image"
1112
/>
1213

1314
<q-file
1415
name="cover_files"
1516
v-model="files"
17+
filled
1618
multiple
1719
use-chips
1820
label="Select cover images"

docs/src/pages/vue-components/button-toggle.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,37 @@ The QBtnToggle component is another basic element for user input, similar to QRa
1616

1717
## Usage
1818

19+
### Basic
20+
1921
<doc-example title="Basic" file="QBtnToggle/Basic" />
2022

23+
### Design
24+
2125
::: tip
2226
Since QBtnToggle uses QBtn, you can use design related props of QBtn to style this component.
2327
:::
2428

2529
<doc-example title="Some design examples" file="QBtnToggle/Design" />
2630

31+
<doc-example title="Spread horizontally" file="QBtnToggle/Spread" />
32+
33+
<doc-example title="On a dark background" file="QBtnToggle/Dark" dark />
34+
35+
### Custom content
36+
2737
First QBtnToggle below has tooltips on each button. Second QBtnToggle has customized the content. Notice the `slot` prop in the `options` Object definition. When you use this `slot` prop, you don't necessary need the `label`/`icon` props in `options`.
2838

2939
<doc-example title="Custom buttons content" file="QBtnToggle/CustomContent" />
3040

31-
<doc-example title="Spread horizontally" file="QBtnToggle/Spread" />
41+
### Disable and readonly
3242

3343
<doc-example title="Disable and readonly" file="QBtnToggle/DisableReadonly" />
3444

35-
<doc-example title="On a dark background" file="QBtnToggle/Dark" dark />
36-
3745
### Native form submit
3846

39-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QBtnToggle, otherwise formData will not contain it (if it should) - all value are converted to string (native behaviour, so do not use Object values):
47+
<q-badge label="v1.9+" />
48+
49+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QBtnToggle, otherwise formData will not contain it (if it should) - all value are converted to string (native behaviour, so do not use Object values):
4050

4151
<doc-example title="Native form" file="QBtnToggle/NativeForm" />
4252

docs/src/pages/vue-components/checkbox.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ In the example below, we are rendering a `<label>` tag (notice `tag="label"`) so
8282

8383
### Native form submit
8484

85-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QCheckbox, otherwise formData will not contain it (if it should) - all value are converted to string (native behaviour, so do not use Object values):
85+
<q-badge label="v1.9+" />
86+
87+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QCheckbox, otherwise formData will not contain it (if it should) - all value are converted to string (native behaviour, so do not use Object values):
8688

8789
<doc-example title="Native form" file="QCheckbox/NativeForm" />
8890

docs/src/pages/vue-components/color-picker.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ You can also pick the default view, like in example below, where we also specify
6464

6565
### Native form submit
6666

67-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QColor, otherwise formData will not contain it (if it should):
67+
<q-badge label="v1.9+" />
68+
69+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QColor, otherwise formData will not contain it (if it should):
6870

6971
<doc-example title="Native form" file="QColor/NativeForm" />
7072

docs/src/pages/vue-components/date.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ When using the persian calendar, the mask for QDate is forced to `YYYY/MM/DD`.
158158

159159
### Native form submit
160160

161-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QDate, otherwise formData will not contain it (if it should):
161+
<q-badge label="v1.9+" />
162+
163+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QDate, otherwise formData will not contain it (if it should):
162164

163165
<doc-example title="Native form" file="QDate/NativeForm" />
164166

docs/src/pages/vue-components/file-picker.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ You can also apply custom filters (which are executed after user picks files):
9090

9191
### Native form submit
9292

93-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QFile, otherwise formData will not contain it (if it should):
93+
<q-badge label="v1.9+" />
94+
95+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QFile, otherwise formData will not contain it (if it should):
9496

9597
<doc-example title="Native form" file="QFile/NativeForm" />
9698

docs/src/pages/vue-components/form.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,24 @@ this.$refs.myForm.resetValidation()
5555

5656
## Turning off Autocompletion
5757
If you want to turn off the way that some browsers use autocorrection or spellchecking of all of the input elements of your form, you can also add these pure HTML attributes to the QForm component:
58+
5859
```html
5960
autocorrect="off"
6061
autocapitalize="off"
6162
autocomplete="off"
6263
spellcheck="false"
6364
```
6465

66+
## Submitting to a URL
67+
If you are using the native `action` and `method` attributes on a QForm, please remember to use the `name` prop on each Quasar form component, so that the sent formData to actually contain what the user has filled in.
68+
69+
```html
70+
<q-form action="https://some-url.com" method="POST">
71+
<q-input name="firstname" ...>
72+
<!-- ... -->
73+
</q-form>
74+
```
75+
6576
## QForm API
6677
<doc-api file="QForm" />
6778

docs/src/pages/vue-components/input.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,11 @@ You can also customize the slot for error message:
292292

293293
<doc-example title="Slot for error message" file="QInput/ValidationSlots" />
294294

295-
### Native form submit
295+
## Native form submit
296296

297-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QInput, otherwise formData will not contain it (if it should):
297+
<q-badge label="v1.9+" />
298+
299+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QInput, otherwise formData will not contain it (if it should):
298300

299301
<doc-example title="Native form" file="QInput/NativeForm" />
300302

docs/src/pages/vue-components/knob.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,40 @@ The QKnob component is used to take a number input from the user through mouse/t
1111
<doc-installation components="QKnob" />
1212

1313
## Usage
14+
1415
By default, QKnob inherits current text color (as arc progress color and inner label color) and current font size (as component size). For customization, you can use the size and color related props.
1516

17+
### Basic
18+
1619
<doc-example title="Basic" file="QKnob/Basic" />
1720

21+
### Show value
22+
1823
In the example below, `show-value` property also enables the default slot, so you can fill it with custom content, like even a QAvatar or a QTooltip. The `font-size` prop refers to the inner label font size.
1924

2025
<doc-example title="Show value" file="QKnob/ShowValue" />
2126

27+
### Min and max
28+
2229
<doc-example title="Custom min/max" file="QKnob/MinMax" />
2330

31+
### Custom step
32+
2433
<doc-example title="Custom step" file="QKnob/Step" />
2534

35+
### Offset angle
36+
2637
<doc-example title="Offset angle" file="QKnob/Angle" />
2738

39+
### Disable and readonly
40+
2841
<doc-example title="Disable and readonly" file="QKnob/DisableReadonly" />
2942

3043
### Native form submit
3144

32-
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with DotNet controllers), you need to specify the `name` property on QKnob, otherwise formData will not contain it (if it should):
45+
<q-badge label="v1.9+" />
46+
47+
When dealing with a native form which has an `action` and a `method` (eg. when using Quasar with ASP.NET controllers), you need to specify the `name` property on QKnob, otherwise formData will not contain it (if it should):
3348

3449
<doc-example title="Native form" file="QKnob/NativeForm" />
3550

0 commit comments

Comments
 (0)