The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Limit the number of times a date can be selected by the current user

Labels

This Discussion is public

Notifications

I am trying to limit the number of times the current user can select the same date from the date field. The codes on this page (https://formidableforms.com/knowledgebase/frm_validate_field_entry/#kb-limit-the-number-of-times-a-date-can-be-selected) does 99% of what I want to do. How do I limit the results to only those of the current logged in user? i.e I want the same date NOT to be selected by the current user but another user can select that date.

Hi Albert,
I had a quick look. In your code snippet, there is a call to "FrmEntryMeta::get_entry_metas_for_field". The 3rd parameter in that function looks like can be used to add filters. "frm_items" table has user_id column. So you can add a filter to limit user_id to the current user id. You can read the source code here and try to figure out how to add the filter - https://github.com/Strategy11/formidable-forms/blob/master/classes/models/FrmEntryMeta.php

If this is too technical for you, I suggest hiring a developer.

Sujeevan

Hi Sujee

Apologies for my delayed reply.

Loads of thanks for your assistance. I am going to try out your suggestion. I will report back ASAP

Regards

Albert

Discussion closed.