How can I disabled the submit button if the uploaded file is larger the setted maximum file size? #1359
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
When the file component displays a warning, it means that the data is not saved. The data object sent with the attachment or file being saved is empty. To address this issue, we can add a validation check to ensure that the Required field on the file component is ticked. This will disable the submit button (as the "disable on form invalid" is ticked) since the data file added will be empty unless it is less than the actual size. I will update you on the size validation check based on the Maxfile Size provided. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Yes, we can add the logic to make the file component ‘required’ based on the value of the radio button. Step 1: Add a new logic in the file component. Step 3: add the max size of the file. As a result, when the radio button is yes, the file component will be required, the submit button will be disabled and the file size will be as expected. The sample form json can be referred here: |
Beta Was this translation helpful? Give feedback.
Yes, we can add the logic to make the file component ‘required’ based on the value of the radio button.
Step 1: Add a new logic in the file component.
Step 2: And add the action
Step 3: add the max size of the file.
As a result, when the radio button is yes, the file component will be required, the submit button will be disabled and the file size will be as expected.
The sample form json can be referred here:
https://gist.github.com/Josephalexantony-aot/9b49b8f6bd1ba516205254111cbd64de