Support

Account

Home Forums General Issues update_field in a loop of a list of users Reply To: update_field in a loop of a list of users

  • G’day Mate,

    At the first glance of you code, I’ve notice 2 things that might or might not be the issue.

    1. On the line where you update the field, you have $_POST['tri']. I don’t see any form field named ‘tir’ in your code.

    2. The nature of checkout input is that, if the checkbox is not check, nothing will be sent upon submission (not even 0). So usually people do this on the true/false checkbox to ensure some value is sent out:

    
    <input type="hidden" name="some-name" value="0" />
    <input type="checkbox" name="some-name" value="1" />
    

    If above fixes doesn’t resolve, I’d suggest to simply your code to the minimal and make sure it works first, before adding all the custom functions and condition. For example, remove the permission check and fetching specific users. Just list all the users (or first 10), and test if the field updating works first. Then, start adding code back.

    Cheers, 🤓