AnsweredAssumed Answered

Problems using PHP getValueList

Question asked by terrybohach on Apr 14, 2016
Latest reply on Apr 14, 2016 by Mike_Mitchell

I get a page error when trying to use the php getValueList command.

 

If i comment out the getValueList the page will display.

 

<?php

# Create the html for the list menu.

# Get the layout where the drop down menu is being used.

$layout =& $fm->getLayout('Demo php');

 

# Get the values from the SampleValueList in the database.

# Note: the values are stored as an array.

# Syntax: $values = $layout->getValueList('ValueListName');

$values = $layout->getValueList('SampleValueList');

 

# Start the html for the list menu.

# Note: "Number" will be the variable passed in the URL.

$list_menu = '<select name="Number">';

 

# Grab each value from the SampleValueList in the database.

# Values are stored between the option tags: <option value="Value">Value</option>

foreach ($values as $value)

{

$list_menu .='<option value="' . $value . '">' . $value . '</option>';

}

 

# Close the select tag for the list menu.

$list_menu .= '</select>';

Outcomes