0

Trying to implement a dropdown menu in sell_form.php so that the user can choose one of the stocks he/she owns and sell it. However, the dropdown menu doesn't seem to be working properly, can someone help?

<select>
        <!-- the selected attribute preselects the tag -->
        <option selected="selected"> Choose One </option>
        <?php foreach($symbols as $symbol => $value){ ?>
        <option value="<?php $value ?>"><?= $value ?></option>
        <?php } ?>
</select>

I'm passing in $symbols as the array that contains all the stocks the user owns

0

I'm an idiot, I passed the wrong variable name (symbol instead of symbols) using render(). Problem fixed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .