#  custom event page

**URL:** <https://forum.wixstudio.com/t/custom-event-page/3341>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [March 22, 2023, 3:33pm UTC](https://forum.wixstudio.com/t/custom-event-page/3341 "2023-03-22T15:33:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohad55517](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ohad55517/32/28916_2.png) [@ohad55517](https://forum.wixstudio.com/u/ohad55517)\
**Post date:** [March 22, 2023, 3:33pm UTC](https://forum.wixstudio.com/t/custom-event-page/3341/1 "2023-03-22T15:33:45Z")

</div>

Hi, I’m trying to generate code for a custom event page.  
The code should hide the button “button17” when the value of type is equal to “View only”.  
I wrote the attached code and it doesn’t work for me.  
I would appreciate your help.

import wixLocation **from** ‘wix-location’ ;  
import wixData **from** ‘wix-data’ ;  
import events **from** ‘wix-storage’ ;  
import wixEvents **from** ‘wix-events’ ;

export function dynamicDataset\_ready ( ) {  
**let** typeElement = $w ( “#dynamicDataset” ). getCurrentItem (). type ;

**if** ( typeElement . value === “View Only” ) {  
$w ( “#button17” ). hide ();  
$w ( “#button18” ). show ();  
}

}

---

<div class="post-metadata">

**Author:** ![amandam](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amandam/32/79539_2.png) [@amandam](https://forum.wixstudio.com/u/amandam)\
**Post date:** [March 22, 2023, 6:05pm UTC](https://forum.wixstudio.com/t/custom-event-page/3341/2 "2023-03-22T18:05:25Z")

</div>

A few things are looking off here to me…

1. where is your page onReady and datasetOnReady code?

2. what is returning for typeElement? (you can use a console.log() to check this)

References that may help you with your code:  
[https://www.wix.com/velo/reference/wix-dataset/dynamicdataset/getcurrentitem](https://www.wix.com/velo/reference/wix-dataset/dynamicdataset/getcurrentitem)

[https://www.wix.com/velo/reference/$w/onready](https://www.wix.com/velo/reference/$w/onready)
