Field Error Highlighting
AnsweredI have a number of forms that all collect the same information but in different languages.
The list has a number of mandatory columns and when the form is submitted I see the standard 'You cannot leave this field blank' message.
Firstly, is there a way to change this message so that it is translated for each language?
If I was to remove the mandatory entry of these columns information I could potentially create my own translated message, but what I wold really like to be able to do is place a red border around the field that hasn't been entered and display a generic message in language indicating that there are missing fields.
How do I do this?
Sandy
-
Hi Sandy
If you use standard SharePoint mandatory fields then message 'You cannot leave this field blank' will be translated by SharePoint to that language that current user has in his profile as display language.
If you use Rich Forms "Required Expression" so then you can try use also "Validation" and "Validation Text" Expressions where you can check language and show message in correct language. For making border red you can apply css style for such fields. You can, for example, use jQuery selectors on Form action and change border color with it.
Best Regards
Vladislav Noskov
0 -
Hi Sandra Huntley,
you can find two different possibilities in this knowledge base article How can I use CSS styles on my form?
For your case you can use the following CSS styles:
.ard-formwebpart .ms-csrformvalidation{
padding:5px;
border: 1px solid #bf0000;
}0 -
Hi,
If I wanted to do the same thing for fields in a sub-list on the form, how would this be applied?
Regards
Sandy
0 -
Validation of sublist's values is not a Rich Forms feature.
For styling the SP ootb gridview messages check the HTML with developer Tool (F12) and add styles to the form same way as for Matthias described.
As you see MS styled it with inline styles... so you have to add some " !important;" at the end of your styles.
0
Please sign in to leave a comment.
Comments
4 comments