volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Show Required fields in XForms

Hi,

How can you display an asterix against all required fields dynamically? Im using Episerver 7.

Thanks

Jon

#174297
Jan 24, 2017 9:10

Im not sure if xforms appending an class to the label. But if it does, use css :after selector and by using the content: "*" you can achieve it. Have a look.

#174397
Jan 25, 2017 15:26

No it doesnt give a class - I was hoping for something like that

#174398
Jan 25, 2017 15:28

And by doing this you can also specify other css properties like color etc.

So 

<label class="required">My Custom Label</label>
label.required:after {
     content: "*";
     color: red;
}

Will result in:

My Custom Label [color="red"]*[/color]

Link to demo (JSFiddle)

#174399
Jan 25, 2017 15:32

According to this post EPiServer have a class-field

Take a look http://stackoverflow.com/questions/33138265/clientside-validation-using-xforms-mvc-application

#174400
Jan 25, 2017 15:35
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.