I'm implementing an expense claim. And the users are required to attach a receipt except if they are only claiming mileage. How do I create a condition on the attachments to be required if they select yes on a "yes/no - Mileage Only" field.
I tried to put a rule on the attachments to make it disabled if the user selects mileage only=yes. But how do i make it required to complete if mileage only=No?!
I found earlier an article here that explains how to make fields required on a single line of text but it doesn't apply the same way on "attachments" as there is no named control for attachments. I also don't want to disable the save button, i need it to give an error message to the user to explain what is missing.
Solved! Go to Solution.
Thanks Brendan. I haven't written java script before. would you be able to take a look at this and let me know if that would work? given that mileageonly is a yes/no field and that i want the attachment to be required when it is marked as "No".
appreciate the help
Thanks Marian. Would you kindly show me an actual example of how you get the AttachmentsClassId or class name? I tried to insert the .nf-attachmentstable, I tried the guid(id) from the source of the page. but I can't get it to validate and work. it is still allowing the user to save the form.
HELP!!! I need to get this out of the way, it has been 2 days already spent on 1 validation 😞
Thanks Marian Hatala for the reminder . and apologies on the delayed response.
I did solve it by adding a function into the min attachments field. It doesn't perfectly work fine in all cases, but I can live with it.