on page load, check a value ind the form, is the same as a value in user meta key.

By: Henning Jønsson | Asked: 11/21/2024
ForumsCategory: Code Helpon page load, check a value ind the form, is the same as a value in user meta key.
Henning Jønsson asked 6 hours ago

Hiiii I need som code help. :)
When i Edit a form, i want som code to check a value in the form. If the value is the same as a value ind the users meta key, every thing is fine. If not - hide the form. and write "Permission denied"   Field id = 220 [user_meta key=firmacvr]  

1 Answers
Rob LeVineRob LeVine answered 26 minutes ago
One way is to create a hidden field & set its default value to [user_meta key=firmacvr]. Then use jQuery to compare the values and hide/show as you desire. One issue would be that if the value of firmacvr is going to change at some point, then you'll have to get the user meta value from jQuery because the default value only works for the initial creation of the form.

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
crossarrow-right