Conditional in User Meta

By: Alaid Arguello | Asked: 09/22/2023
ForumsCategory: General questionsConditional in User Meta
Alaid Arguello asked 7 months ago
Hi, Is there a way to add 2 or more User Metas with the same name to the same form and depending on the answer the user selects, only the field that the user filled out is stored? That is, I have a User Meta "pharmacy" assigned to a Field A and a Field B, but the user depending on the options they choose will only be able to fill out Field A or Field B, which makes one of the two fields contain information and the other is empty, therefore depending on the order that is used in some cases the last value that will be stored in the User Meta "pharmacy" will be empty, but if there is a conditional to prevent this from happening it would be fantastic. Thanks.
Rob LeVineRob LeVine replied 7 months ago

I'm not 100% sure I follow the question. When you say that a "User Meta" is assigned to the fields, what do you mean? Is the goal to have whatever value that the user enters (Field A or B) written into the usermeta database table when the form is submitted?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community