Try our conversational search powered by Generative AI!

Show Required fields in XForms

Vote:
 

Hi,

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

Thanks

Jon

#174297
Jan 24, 2017 9:10
Vote:
 

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
Vote:
 

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

#174398
Jan 25, 2017 15:28
Vote:
 

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
Vote:
 

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.