Forum
Remove member tag after form submitted
I am looking to create a simple online vote function for members of a site. I plan to display the vote page based on them having a tag "vote" assigned to their member account. I will then use Perch forms for their vote. I would then like to remove the "vote" tag from their member account so they can not vote again. is it possible to use the
<?php perch_member_remove_tag('vote'); ?>
function from a form as it is submitted. I can see that you can add multiple apps to a form but how could I add this function or make it run after the form has been submitted?
Any ideas appreciated
Add
<?php perch_member_remove_tag('vote'); ?>
to a layout, then add layout to your forms success section of the template.Brilliant, thanks Robert, I will give it a try and report back.
That seems to work. I have added another bit to log the user out after the tag is removed as tag changes only seem to work once you log in again. so my for success not looks like this:
with the layout logout.php having:
Thanks again for your help.