[eluser]Unknown[/eluser]
Hey there!
Here is the code in my view. I have confirmed that each variable in curly braces (eg {staff_id}) exists by echoing it.
Code:
<div>
<?= form_open('outreach/assign_follow_up/save') ?>
{visitors}
<?= form_fieldset() ?>
<?= form_label('{first_name} {last_name}', 'assignment[{member_id}]', array('class' => 'big')) ?>
<?php if ($group_status == "good"): ?>
<?= form_dropdown('assignment[{member_id}]', $follow_up_group, '{staff_id}', 'style="float:right;" id="assignment[{member_id}]"') ?>
<span>Assign to:</span>
<?php else: ?>
<?= form_dropdown('assignment[{member_id}]', $follow_up_group, '{staff_id}', 'style="display:none; float:right;" id="assignment[{member_id}]"') ?>
<span>No one is available to contact this visitor.</span>
<?php endif; ?>
<?= form_fieldset_close() ?>
{/visitors}
<?php if ($group_status == "good"): ?>
<?= form_submit('submit', 'Submit') ?>
<?= form_reset('reset', 'Start Over') ?>
<?php endif; ?>
<?= form_close() ?>
</div>
Here is what the variable $follow_up_group looks like:
Code:
Array
(
[none] => No Assignment
[Assign to:] => Array
(
[1] => Smith, John
[8] => Gates, Bill
)
)
So.... my question: why won't the dropdown default to {staff_id}? The first iteration of {visitors} returns a {staff_id} of 8, so that dropdown should be defaulting to "Gates, Bill", right? No? What's up?