How to implement a 'where' statment in a from generated dropdown?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 18, 2020   (RSS)

By nmsinc - January 13, 2020

I have a set of code that was generated by the form application plugin listed below - how do I add a 'where' clause to this set of code?

Thanks!

<div class="form-group">
  <label for="merge_with">May Be Associated With The Following Debtor</label> (Choose a debtor here that you want the account to be associated with!)
  <?php $optionValuesToLabels = getListOptions($FORM_TABLE, 'merge_with'); ?>
  <?php $optionsHTML          = getSelectOptions(@$_REQUEST['merge_with'], array_keys($optionValuesToLabels), array_values($optionValuesToLabels)); ?>
  <select name='merge_with' id='merge_with' class='form-control'><option value=''>-- select --</option><?php echo $optionsHTML; ?></select>
</div>

nmsinc

By daniel - January 17, 2020

Hi nmsinc,

I don't believe there's a way to directly supply a "where" to getListOptions(), so if you want to filter the options that show up in the dropdown you'll need to take a different approach. If you can tell me a bit more about what/how you're trying to filter, then I should be able to give you some options for how to go about it.

Thanks!

Daniel
Technical Lead
interactivetools.com