Using the ariaRequired on a Form Field in Cloudscape #813
-
New to cloudscape trying to build a Form that will prevent the user from submitting the form if a required field is blank. Seems like the ariaRequired Boolean is what I need. I placed it in the Form Field hoping it would prevent the Form from being submitted but the form still goes thru. A check in the console of the event shows ariaRequired=true. Not sure what I am missing to get this implement. Searched the docs but a answer did not click and wasnt able to find any examples in the provided code that utilized required fields. Sry about the poorly formatted question and code .... still new to this
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, No worries, your question is totally fine and don't hesitate on asking questions to us and we'll come back to you as soon as we could! As for the validation we leave this part to be entirely controlled by your side, so in your sample you'll have to implement a way to validate after the user submits, so in this case:
This is one way of doing so, you can also rely on external validation libraries like Hope that helps! |
Beta Was this translation helpful? Give feedback.
Hello,
No worries, your question is totally fine and don't hesitate on asking questions to us and we'll come back to you as soon as we could!
As for the validation we leave this part to be entirely controlled by your side, so in your sample you'll have to implement a way to validate after the user submits, so in this case:
This is one way of doing so, you can also rely on external validation libraries like
zod
andyup
to carry out such validations and get error messages for you, we have a general guideline here that you can follow