How do i get the input value of the every second column of a list field for use in gform_validation?
I found this:
http://www.gravityhelp.com/forums/topic/list-field-help#post-39885
But '$list_values = unserialize($field[6]);' gives an empty array.
How do i get the input value of the every second column of a list field for use in gform_validation?
I found this:
http://www.gravityhelp.com/forums/topic/list-field-help#post-39885
But '$list_values = unserialize($field[6]);' gives an empty array.
Is the list field in your form field 6? If not, you will need to change that number to the actual field number.
Can you dump the $entry using print_r and post the results at pastie.org or pastebin.com so we can see what field it actually is and what it contains? Thank you.
I normaly get the input of the other fields by:
$field_value = rgpost("input_{$field['id']}");
But this field has multiple columns and a variable number of rows. I only want to validate the input of every second column of every row.
OK, can you dump the complete $entry though and see what it contains? We have to at least have something in the array before we can process every other column in every row.
I want to validate the column: ticketnummer
OK, it looks like that field has a value. This is the value of $field[6]?
You said: "$list_values = unserialize($field[6]);' gives an empty array" but it appears this field, if this is field 6, actually contains serialized data? I can't figure out how unserialize would not return an array. If you print_r $list_values, it is empty?
Allright it gives an array
That means the problem lies somewhere in the validation, I think i can make it work now.
Thanks!
I think you have it now. You just have to loop through the array and extra the columns you want from every row. Let us know if you need anything else.