Invalid Populated Field In Child
- This topic has 2 replies, 2 voices, and was last updated 4 years, 5 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › vLooup for SharePoint › Invalid Populated Field In Child
Tagged: read-only child
Hi Alexander,
Many times when populating fields in the child form, I make them read-only so they match the parent. The issue I’ve run into is that if it populates a field such as people picker and that user no longer exists, it won’t allow the user to save the child. There’s no indication as to why – it just bumps up to the top of the form. When I troubleshoot, I release the read-only rule to find that the people picker will rightfully not accept the now invalid user.
I’m wondering if there is a way to show the user the indicator that the populated (and read-only) field cannot be validated. Or any other suggestions you may have. Thanks for your time!
Hi,
You can add this to your custom js to make a field editable when a validation error exists:
setInterval(function(){
jQuery(".ms-formvalidation").each(function(i, elm){
var tr = jQuery(elm).parents("tr:first");
var fin = tr.attr("id").split("dffs_")[1];
var isReadonly = tr.hasClass("dffs-readonly");
if(fin !== undefined && isReadonly){
spjs.dffs.undoReadOnly([fin]);
}
});
},3000);
Let me know how this works out.
Alexander
That works! Awesome as always!