I have a form with a couple of text areas and then about 20 input fields.
The input fields are created dynamically, using a loop and are created from values in my db (countries)
My code is:
$options = '';
$country_code = '';
$query = $DB->query("SELECT country_code, country_id, IF(country_code = ".$country_code."', '', '') AS sel FROM exp_sme_countries WHERE site_id='".$this->settings['site_id']."' ORDER BY country_name ASC");
foreach ($query->result as $row)
{
$options .= '<label>' . 'Phrase for ' . $this->settings['countries'][$row['country_code']] . '</label>' . '<br />';
$options .= '<input style="width: 100%; height: 5%;" id="country_data" type="text" name="' . $row['country_id'] . '" />' . '<br /><br />';
$options .= '<input type="hidden" name="country_id" id="country_id" value="' . $row['country_id'] . '" />';
}
This outputs examples such as:
input style="width: 100%; height: 5%;" id="country_data" type="text" name="68" />
input style="width: 100%; height: 5%;" id="country_data" type="text" name="28" />
Now my problem is, how do I get the values of these input fields?
I have looked at outputting $_POST, but this seems to return data that I can't really access.
Can these values be accessed in any way?
Or do I need to change the way I'm doing things?
Thanks