diff options
| author | Shulhan <ms@kilabit.info> | 2023-05-05 18:21:07 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-05-05 18:21:07 +0700 |
| commit | c484bc6ec480dd799c491b3dd0f673f822c3b484 (patch) | |
| tree | f76ebab69a6840e280eb7d10df71a451faabc922 /form_input.go | |
| parent | 36a4816c921c2c52118ebe2ad9c9e39fe8e587a4 (diff) | |
| download | gorankusu-c484bc6ec480dd799c491b3dd0f673f822c3b484.tar.xz | |
all: add boolean Kind for FormInput, FormInputKindBoolean
The FormInputKindBoolean only used for convertion, for example
ToJsonObject.
In the WUI, it still rendered as string, not as checkbox.
FormInput with this Kind will be converted to true in ToJsonObject if
the Value is either "true", "yes", or "1".
Diffstat (limited to 'form_input.go')
| -rw-r--r-- | form_input.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/form_input.go b/form_input.go index 48ad067..5fd0a8d 100644 --- a/form_input.go +++ b/form_input.go @@ -5,9 +5,14 @@ package trunks type FormInputKind string +// List of valid value for field FormInput.Kind. const ( - FormInputKindNumber = "number" - FormInputKindString = "string" + // FormInputKindBoolean only used for convertion, for example + // ToJsonObject. + // In the WUI, it will be rendered as string. + FormInputKindBoolean = `boolean` + FormInputKindNumber = `number` + FormInputKindString = `string` ) // FormInput provide the information to create an input component. |
