Labels that contain a required field get a red outline.
Email address
Depends on email
This field will become required if the email field is filled out
Choose an option
Select an option
Option 1
Option 2
Option 3
Depends on email or select
This field is required if the email field is filled out or if the
select
has Option 3 chosen. It uses a custom indicator placed before the label text.
Depends on email
This field is required if the email field is filled out and it uses a custom indicator
Depends on email being "foo@bar.tld"
This field is required if the email field is filled out specifically with the text "foo@bar.tld"
Choose an option
Option 1
Option 2
Option 3
Other
Other value
Choose an option
Option 1
Option 2
Option 3
Other
Other value
Required if there’s an email value
The only difference from previous examples is that the
label
&
input
elements are not nested.
Required if there’s an email value
The only difference from previous example is that the label contains one
span
element.
Required if
there’s an email value
The only difference from previous example is that the label contains two
span
elements.
Required if
there’s an email value
The only difference from previous example is that the indicator is positioned "before" the label text.
Required if
there’s an email value
The only difference from previous example is that the label now wraps the
input
as well.
Submit