Support › Meta Box Builder › Validation for data uniquenessResolved
How to validate a field data see if it's unique?
For example, I would like to force stock# field unique.
Do you mean the field value is unique in the database? You can use the validation rule remote to check the field value with a PHP function.
Refer to these topics to know how to use
So should I input the rule to this value field?
I do understand how to check in PHP via ajax but not sure how to send in the frontend.
You should use the code to validate the field value and refer to this topic https://support.metabox.io/topic/remote-validation-example/.
If you are using the extension MB Frontend Submission, it works as same as on the backend.
So I should input something like these to the value field of validation section?
I think I got it.
I should set this to the value field, right? it worked.
One more question, how do I check the id of the post that is sending remote validation in PHP?