UNPKG

formio-sfds

Version:
29 lines (26 loc) 4.62 kB
<!doctype html> <html lang="en"> <head> <title>Error messages | formio-sfds examples</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="/sfgov/forms.css"> </head> <body> <div class="formio-sfds"> <div class="container p-2"> <h1 class="h3 mb-4"> <a href="/">formio-sfds@10.0.0</a> / Error messages </h1> <sfgov-form data-form="{&quot;components&quot;:[{&quot;type&quot;:&quot;fieldset&quot;,&quot;legend&quot;:&quot;Textfield&quot;,&quot;components&quot;:[{&quot;type&quot;:&quot;textfield&quot;,&quot;key&quot;:&quot;textfieldMaxLength&quot;,&quot;label&quot;:&quot;Max length&quot;,&quot;defaultValue&quot;:&quot;this is too long&quot;,&quot;validate&quot;:{&quot;maxLength&quot;:10}},{&quot;type&quot;:&quot;textfield&quot;,&quot;key&quot;:&quot;textfieldMaxLengthCustom&quot;,&quot;label&quot;:&quot;Max length + custom message&quot;,&quot;defaultValue&quot;:&quot;this is too long&quot;,&quot;validate&quot;:{&quot;maxLength&quot;:10,&quot;customMessage&quot;:&quot;Custom error message&quot;}},{&quot;type&quot;:&quot;textfield&quot;,&quot;key&quot;:&quot;textfieldMaxLengthRequired&quot;,&quot;label&quot;:&quot;Max length (required)&quot;,&quot;defaultValue&quot;:&quot;this is too long&quot;,&quot;validate&quot;:{&quot;required&quot;:true,&quot;maxLength&quot;:10}},{&quot;type&quot;:&quot;textfield&quot;,&quot;key&quot;:&quot;textfieldMaxLengthRequiredCustom&quot;,&quot;label&quot;:&quot;Max length (required) custom message&quot;,&quot;defaultValue&quot;:&quot;this is too long&quot;,&quot;validate&quot;:{&quot;required&quot;:true,&quot;maxLength&quot;:10,&quot;customMessage&quot;:&quot;Custom error message&quot;}}]},{&quot;type&quot;:&quot;fieldset&quot;,&quot;legend&quot;:&quot;Email&quot;,&quot;components&quot;:[{&quot;type&quot;:&quot;email&quot;,&quot;key&quot;:&quot;emailInvalid&quot;,&quot;label&quot;:&quot;Email (invalid)&quot;,&quot;defaultValue&quot;:&quot;not an email&quot;},{&quot;type&quot;:&quot;email&quot;,&quot;key&quot;:&quot;emailRequiredInvalid&quot;,&quot;label&quot;:&quot;Email (invalid + required)&quot;,&quot;defaultValue&quot;:&quot;not an email&quot;,&quot;validate&quot;:{&quot;required&quot;:true}},{&quot;type&quot;:&quot;email&quot;,&quot;key&quot;:&quot;emailRequiredInvalidEmpty&quot;,&quot;label&quot;:&quot;Email (invalid + required, empty)&quot;,&quot;validate&quot;:{&quot;required&quot;:true}}]},{&quot;type&quot;:&quot;fieldset&quot;,&quot;legend&quot;:&quot;Radio&quot;,&quot;components&quot;:[{&quot;type&quot;:&quot;radio&quot;,&quot;key&quot;:&quot;radioRequired&quot;,&quot;label&quot;:&quot;Radio (required)&quot;,&quot;values&quot;:[{&quot;label&quot;:&quot;One option&quot;,&quot;value&quot;:1},{&quot;label&quot;:&quot;Another option&quot;,&quot;value&quot;:2}],&quot;validate&quot;:{&quot;required&quot;:true}},{&quot;type&quot;:&quot;radio&quot;,&quot;key&quot;:&quot;radioRequiredCustom&quot;,&quot;label&quot;:&quot;Radio (required, custom message)&quot;,&quot;values&quot;:[{&quot;label&quot;:&quot;One option&quot;,&quot;value&quot;:1},{&quot;label&quot;:&quot;Another option&quot;,&quot;value&quot;:2}],&quot;validate&quot;:{&quot;required&quot;:true,&quot;customMessage&quot;:&quot;Please choose an option.&quot;}}]},{&quot;type&quot;:&quot;fieldset&quot;,&quot;legend&quot;:&quot;Checkboxes (select boxes)&quot;,&quot;components&quot;:[{&quot;type&quot;:&quot;selectboxes&quot;,&quot;key&quot;:&quot;selectboxesRequired&quot;,&quot;label&quot;:&quot;Select boxes (required)&quot;,&quot;values&quot;:[{&quot;label&quot;:&quot;One option&quot;,&quot;value&quot;:1},{&quot;label&quot;:&quot;Another option&quot;,&quot;value&quot;:2}],&quot;validate&quot;:{&quot;required&quot;:true}},{&quot;type&quot;:&quot;selectboxes&quot;,&quot;key&quot;:&quot;selectboxesRequiredCustom&quot;,&quot;label&quot;:&quot;Select boxes (required, custom message)&quot;,&quot;values&quot;:[{&quot;label&quot;:&quot;One option&quot;,&quot;value&quot;:1},{&quot;label&quot;:&quot;Another option&quot;,&quot;value&quot;:2}],&quot;validate&quot;:{&quot;required&quot;:true,&quot;customMessage&quot;:&quot;Please choose an option.&quot;}}]}]}" data-options="{&quot;example&quot;:{&quot;submit&quot;:true}}"> </sfgov-form> </div> </div> <script src="https://unpkg.com/formiojs@4.14.8/dist/formio.full.min.js"></script> <script src="/dist/formio-sfds.standalone.js"></script> <script src="/dist/examples.js"></script> </body> </html>