Grid Search --> Checkbox value as Array ??

Hi!

I have a grid where i have a field type Checkbox. I want to use the value of the checkbox checked in some other event in the grid but when i use the field, the value appears as Array.

Is there any way i can get the checkbox value which i can use in the grid events for ex. for lookup or something and not just ‘Array’?

I think i have written about the exact problem long time ago under “Bugs” section.

Thanks!

Re: Grid Search --> Checkbox value as Array ??

This is still comming as Array in V6 also.

Would be glad it it could be fixed or if someone would show me a way around to get the values of the checkboxes??

example: I have a checkbox in the grid field “Somefield” with lookup :
SELECT ID, description
FROM sometable
ORDER BY description

when i try to use the field(which is ID field of sometable) directly in some other event then the value comes as ‘Array’ which is not what i need.

when i do print_r({Somefield});

it shows something like this: Array([0] => 1##@@description1 [1] => 2##@@description2) … and so on…

So how can i get the ID of the checkbox field??

NOTE:

IT happens in Grid: Search

This doesn’t only happen in checkbox but also in double select and select with multiple values.

Re: Grid Search --> Checkbox value as Array ??

You can get the defined value by using a foreach
foreach ({Somefield} as $selected) {
$values .= $selected }
I though using {Somefield[0]}, {Somefield[1]} would work but testing has showed me that you end up getting non selected values with that approach.
I ended up using the the selection like a binary.
Option1 = 1
Option2 = 2
Option3 = 4

and using this
foreach ({Option} as $count) {
[total] += $count[0] }

Re: Grid Search --> Checkbox value as Array ??

ishwor - did you get the answer to the lookup - I am getting the ID and then the description in my grid …