Undefined does not work after correction

I have a database that inserts from the form on the published website.
And the database can fix anyone on the published website.

The form and The fix form have a checkbox.
When the checkbox checked, The button appears.
If the checkbox unchecked, the button disappears.

Up to this point, it works fine.

Once The checkbox checked, cannot hide the button even change the database.

How can I hide after change the database?

my code is:

$w.onReady( function () {

$w( “#repeater1” ).onItemReady( ($w, itemData) => {
console.log(itemData.pdf);
if (itemData.pdf === undefined ){
$w( “#button1” ).hide();
}

if (itemData.labelnew1 === undefined ){
$w( “#button3” ).hide();
}

if (itemData.labelbukken === undefined ){
$w( “#button4” ).hide();
}
});

});

Someone help me

Your CODE and your description do not fit together.
Where did you place your buttons and checkboxes?
Can you show a screenshot of your constalation?

This here hides all your buttons emidiately when no data found for each datafield(data-column) in your DATABASE, when REPEATER is READY.

$w.onReady(function () {
    $w("#repeater1").onItemReady(($item, itemData, index) => {
        console.log(itemData.pdf); 
        if(itemData.pdf === undefined )         {$item("#button1").hide();}
        if(itemData.labelnew1 === undefined )   {$item("#button3").hide();}
        if(itemData.labelbukken === undefined ) {$item("#button4").hide();}
    });
});

What next ?