diff --git a/api/app/Http/Requests/UserFormRequest.php b/api/app/Http/Requests/UserFormRequest.php
index 9596e0924..bf75ca7d9 100644
--- a/api/app/Http/Requests/UserFormRequest.php
+++ b/api/app/Http/Requests/UserFormRequest.php
@@ -91,7 +91,7 @@ public function rules()
// Text field
'properties.*.multi_lines' => 'boolean|nullable',
- 'properties.*.max_char_limit' => 'integer|nullable|min:1|max:2000',
+ 'properties.*.max_char_limit' => 'integer|nullable|min:1',
'properties.*.show_char_limit ' => 'boolean|nullable',
'properties.*.secret_input' => 'boolean|nullable',
@@ -134,8 +134,7 @@ public function messages()
return [
'properties.*.name.required' => 'The form block number :position is missing a name.',
'properties.*.type.required' => 'The form block number :position is missing a type.',
- 'properties.*.max_char_limit.min' => 'The form block number :position max character limit must be at least 1 OR Empty',
- 'properties.*.max_char_limit.max' => 'The form block number :position max character limit may not be greater than 2000.',
+ 'properties.*.max_char_limit.min' => 'The form block number :position max character limit must be at least 1 OR Empty'
];
}
}
diff --git a/client/components/forms/CheckboxInput.vue b/client/components/forms/CheckboxInput.vue
index c18df4b34..9bbd60a4e 100644
--- a/client/components/forms/CheckboxInput.vue
+++ b/client/components/forms/CheckboxInput.vue
@@ -5,16 +5,16 @@
-
-
+
+
@@ -28,7 +27,6 @@
-
@@ -77,43 +81,44 @@
-
\ No newline at end of file
+ computed: {},
+ mounted() {
+ if (!this.compVal || typeof this.compVal !== 'object') {
+ this.compVal = {}
+ }
+ },
+ methods: {
+ onSelect(row, column) {
+ if (this.disabled) {
+ return
+ }
+ if (this.compVal[row] === column && !this.required) {
+ this.compVal[row] = null
+ } else {
+ this.compVal[row] = column
+ }
+ },
+ },
+ }
+
\ No newline at end of file
diff --git a/client/components/forms/ToggleSwitchInput.vue b/client/components/forms/ToggleSwitchInput.vue
index 831d89c5e..3dd52d8cd 100644
--- a/client/components/forms/ToggleSwitchInput.vue
+++ b/client/components/forms/ToggleSwitchInput.vue
@@ -5,13 +5,16 @@
-
+
import {inputProps, useFormInput} from "./useFormInput.js"
-import VSwitch from "./components/VSwitch.vue"
import InputWrapper from "./components/InputWrapper.vue"
import InputHelp from "~/components/forms/components/InputHelp.vue"
export default {
name: "ToggleSwitchInput",
- components: {InputHelp, InputWrapper, VSwitch},
+ components: {InputHelp, InputWrapper},
props: {
...inputProps,
},
@@ -73,4 +75,4 @@ export default {
this.compVal = !!this.compVal
},
}
-
+
\ No newline at end of file
diff --git a/client/components/forms/components/CheckboxIcon.vue b/client/components/forms/components/CheckboxIcon.vue
index 2c80db4e0..7296be854 100644
--- a/client/components/forms/components/CheckboxIcon.vue
+++ b/client/components/forms/components/CheckboxIcon.vue
@@ -1,12 +1,24 @@
-
+
+
+
+
-
diff --git a/client/components/open/forms/OpenForm.vue b/client/components/open/forms/OpenForm.vue
index 2569ca42d..792352f4a 100644
--- a/client/components/open/forms/OpenForm.vue
+++ b/client/components/open/forms/OpenForm.vue
@@ -310,7 +310,8 @@ export default {
},
computedStyle() {
return {
- ...this.minHeight ? {minHeight: this.minHeight + 'px'} : {}
+ ...this.minHeight ? {minHeight: this.minHeight + 'px'} : {},
+ '--form-color': this.form.color
}
}
},
@@ -488,10 +489,19 @@ export default {
handleUrlPrefill(field, formData, urlPrefill) {
if (!urlPrefill) return
- const prefillValue = urlPrefill.get(field.id)
+ const prefillValue = (() => {
+ const val = urlPrefill.get(field.id)
+ try {
+ return typeof val === 'string' && val.startsWith('{') ? JSON.parse(val) : val
+ } catch (e) {
+ return val
+ }
+ })()
const arrayPrefillValue = urlPrefill.getAll(field.id + '[]')
- if (prefillValue !== null) {
+ if (typeof prefillValue === 'object' && prefillValue !== null) {
+ formData[field.id] = { ...prefillValue }
+ } else if (prefillValue !== null) {
formData[field.id] = field.type === 'checkbox' ? this.parseBooleanValue(prefillValue) : prefillValue
} else if (arrayPrefillValue.length > 0) {
formData[field.id] = arrayPrefillValue
@@ -503,7 +513,7 @@ export default {
handleDefaultPrefill(field, formData) {
if (field.type === 'date' && field.prefill_today) {
formData[field.id] = new Date().toISOString()
- } else if (field.type === 'matrix') {
+ } else if (field.type === 'matrix' && !formData[field.id]) {
formData[field.id] = {...field.prefill}
} else if (!(field.id in formData)) {
formData[field.id] = field.prefill
diff --git a/client/components/open/forms/OpenFormField.vue b/client/components/open/forms/OpenFormField.vue
index 287a76e51..1d1747821 100644
--- a/client/components/open/forms/OpenFormField.vue
+++ b/client/components/open/forms/OpenFormField.vue
@@ -25,7 +25,7 @@
class="flex lg:flex-col bg-gray-100 dark:bg-gray-800 border rounded-md"
>
@@ -326,7 +326,7 @@ export default {
helpPosition: (field.help_position) ? field.help_position : 'below_input',
uppercaseLabels: this.form.uppercase_labels == 1 || this.form.uppercase_labels == true,
theme: this.theme,
- maxCharLimit: (field.max_char_limit) ? parseInt(field.max_char_limit) : 2000,
+ maxCharLimit: (field.max_char_limit) ? parseInt(field.max_char_limit) : null,
showCharLimit: field.show_char_limit || false,
isDark: this.darkMode
}
diff --git a/client/components/open/forms/components/FormUrlPrefill.vue b/client/components/open/forms/components/FormUrlPrefill.vue
index 0d72ac726..cc5bf8e34 100644
--- a/client/components/open/forms/components/FormUrlPrefill.vue
+++ b/client/components/open/forms/components/FormUrlPrefill.vue
@@ -65,6 +65,8 @@ const preFillUrl = computed(() => {
props.formData[property.id].forEach((value) => {
uriComponents.append(property.id + "[]", value)
})
+ } else if (typeof props.formData[property.id] === 'object') {
+ uriComponents.append(property.id, JSON.stringify(props.formData[property.id]))
} else {
uriComponents.append(property.id, props.formData[property.id])
}
diff --git a/client/components/open/forms/fields/components/FieldOptions.vue b/client/components/open/forms/fields/components/FieldOptions.vue
index 98b1100ed..cb05c3a00 100644
--- a/client/components/open/forms/fields/components/FieldOptions.vue
+++ b/client/components/open/forms/fields/components/FieldOptions.vue
@@ -529,13 +529,13 @@
name="max_char_limit"
native-type="number"
:min="1"
- :max="2000"
:form="field"
label="Max character limit"
- help="Maximum character limit of 2000"
:required="false"
+ @update:model-value="onFieldMaxCharLimitChange"
/>