Hi,
I've just started using CForms and would greatly appreciate some help with my post-processing code:
function my_cforms_ajax_filter($params) {
### triggers on first form
if ( $params['id']=='' ) {
$params['field_7'] = $number; // Making field 7 into variable
$array = str_split($number, 4); // Splits the number into a new element every 4 characters
print_r( $array[0],' ', $array[1],' ', $array[2],' ', $array[3] ); // Ouputs each element with a space in between
$params['field_8'] = $array[0];
$params['field_9'] = $array[1];
$params['field_10'] = $array[2];
$params['field_11'] = $array[3];
}
return $params;
}
What I'm trying to do is separate a 16 digit number into four parts and change the
the hidden fields I have created (8,9,10,11) to the numbers in the array.
It appears that the numbers are being changed as I put default values into them and
are not appearing, however the correct numbers are not appearing in there either.
Thank you for your time.