-
Notifications
You must be signed in to change notification settings - Fork 1
Form Validation Examples
Anastasiia Tsvetkova edited this page Jan 27, 2023
·
11 revisions
This page contains code samples that demonstrate form field validation techniques. You can use simple client-side form validation. Click here to read more about client-side form validation.
Simply add the "required" parameter to the input tag to make a text input field mandatory:
<input class="input__element" type="text" size="30" xmp-write-ador="xmp.r['firstname']" required />.input__element:required:invalid {
border: 1px solid red;
}
.input__element:required:valid {
border: 1px solid green;
}You can test and adjust the above sample code on a personalized or anonymous page:

You're currently viewing XMPL V5. Alternatively, go to XMPL V3