# If current user equals collection user enable button

**URL:** <https://forum.wixstudio.com/t/if-current-user-equals-collection-user-enable-button/17060>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [July 28, 2019, 11:48am UTC](https://forum.wixstudio.com/t/if-current-user-equals-collection-user-enable-button/17060 "2019-07-28T11:48:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![admin28449](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/admin28449/32/13585_2.png) [@admin28449](https://forum.wixstudio.com/u/admin28449)\
**Post date:** [July 28, 2019, 11:48am UTC](https://forum.wixstudio.com/t/if-current-user-equals-collection-user-enable-button/17060/1 "2019-07-28T11:48:49Z")

</div>

Hi  
Please assist how to enable a button if the the current user = the user in the collection.

**Database:**  
Collection: unit  
Collection field: member (reference field to member)  
**Page Elements:**  
Button: buttonOpen (by default it is disabled)

**Pseudo code**  
if the current signed in user = the member on the current item, enable button else disable button.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [July 28, 2019, 12:53pm UTC](https://forum.wixstudio.com/t/if-current-user-equals-collection-user-enable-button/17060/2 "2019-07-28T12:53:52Z")

</div>

Just check with Wix Users API about the current user etc.  
[https://www.wix.com/corvid/reference/wix-users.html](https://www.wix.com/corvid/reference/wix-users.html)

Assuming too, that you would want to query your dataset to check too.  
[https://www.wix.com/corvid/reference/wix-data.html#query](https://www.wix.com/corvid/reference/wix-data.html#query)

Then just enable or disable the button in your code to suit your page.

Here are two previous forum posts about similar that you can view the code used.  
[https://www.wix.com/corvid/forum/community-discussion/multiple-inputs-enable-and-disable-a-button](https://www.wix.com/corvid/forum/community-discussion/multiple-inputs-enable-and-disable-a-button)  
[https://www.wix.com/corvid/forum/community-discussion/disable-checkbox-if-another-checkbox-is-checked](https://www.wix.com/corvid/forum/community-discussion/disable-checkbox-if-another-checkbox-is-checked)
