The following code pulls a column of data from a MIGX list. I need to use the [[!+fi.prodPrice]] (firld:racePriceEarly) for the value in the option. How do I bring both in and explode them seperatly?
[[!options? &input=`[[!+fi.Distance]]` &field=`runDistance`]]
<?php
$output='';
$each=explode(",",$input, -1);
foreach($each as $e){
$output .='<option value="'.$e.'" [[!+fi'.$field.':is=`'.$e.'`:then=`selected`]] >'.$e.'</option>';
}
return $output;
Everything I know I learned on the internet. Saved me thousands in College tuition,
Here's what I ended up with it. I'm pretty proud of myself for figuring it out. Feel free to tweak it.
[[!options? &input=`[[!+fi.Distance]]` &value=`[[!+fi.prodPrice]]` &field=`runDistance`]]
<?php
$output='';
$price=explode(",",$value, -1);
$each=explode(",",$input, -1);
foreach (array_combine($price, $each) as $p => $e)
{
$output .='<option value="'.$p.'" [[!+fi'.$field.':is=`'.$e.'`:then=`selected`]] >'.$e.'</option>';
}
return $output;
Everything I know I learned on the internet. Saved me thousands in College tuition,