explode(): Empty delimiter

In my form I have a checkbox that when checked displays a block and when unchecked hides the block. This block has one field. When navigating records in the form I have the block set to stay hidden if there is nothing in the field. When I navigate to the record that does have a value in the field in the hidden block the check box is not checked but the block is shown like it is supposed to. To make the checkbox stay checked based on the value in the field I used the following code in onLoad:

if ({field} != null)
{
sc_block_display(block, on);
{field} = β€˜Y’;
}
else
{
sc_block_display(block, off);
{field} == β€˜β€™; //or nothing here
}

The problem is that it works the first time and when I navigate records the block acts as it’s supposed to. When I navigate to the record that has data in the field I get an error:

explode(): Empty delimiter.

So, somewhere in the generated php code the delimiter is incorrect? Am I going about this all wrong?

Thanks

I found a work around. If I choose not to navigate records in the form and use a grid linked to a from to navigate then the code works and I get no error.

1 Like