(joomla issue)

I have posted this in joomla forum but noone seems to have an answer, hopefully someone here will know.

I am trying to setup a new custom parameter type to lear how it is done but with little succes I am setting up a select field, I know it is already available in joomla as a list param type but I am doing it for learning purpouses.

Here is the code I have


<?php
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldTestselect extends JFormField{
protected $type = 'Testselect';
protected function getInput(){
$name = $this->element['name'];
$id = $this->element['id'];
$default = $this->element['default'];
$size = (int)$this->element['size'];
$this_counter = 0;
$measuring_type = $this->element['measuring_type'];
$pixels_16 = array ('40px', '100px', '160px', '220px', '280px', '340px', '400px', '460px', '520px', '580px', '640px', '700px', '760px', '820px', '880px', '940px');
$array_values = array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
$measuring;
$options;
if ($measuring_type == 'pixels'){
$measuring = $pixels_16;
}
else if ($measuring_type == 'normal'){
$measuring = $array_values;
}
while ($size > 0){
$options = $options . '<option value="' . $array_values[$this_counter] . '">' . $measuring[$this_counter] . '</option>';
$this_counter ++;
$size --;
}
$this_counter = 0;
$return = '<select id="' . $id . '" name="' . $name . '" default="' . $default . '" >' .  $options . '</select>';
return $return;
}
}
?>

The above does create the select field as I expect, it provides a dropdown selectbox with the needed options, the specified within the xml manifest.

when I select the option in the select field and hit save to save the extension configuration changes nothing is saved in the database, can someone help with this?

here is how I made it save the info in the database


<?php
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
class JFormFieldTlak extends JFormField{
protected $type = 'Tlak';
protected function getInput(){
$name = $this->element['name'];
$id = $this->element['id'];
$default = $this->element['default'];
$size = (int)$this->element['size'];
$this_counter = 0;
$measuring_type = $this->element['measuring_type'];
$pixels_16 = array ('40px', '100px', '160px', '220px', '280px', '340px', '400px', '460px', '520px', '580px', '640px', '700px', '760px', '820px', '880px', '940px');
$array_values = array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
$measuring;
$options;
if ($measuring_type == 'pixels'){
$measuring = $pixels_16;
}
else if ($measuring_type == 'normal'){
$measuring = $array_values;
}
while ($size > 0){
$options = $options . '<option value="' . $array_values[$this_counter] . '">' . $measuring[$this_counter] . '</option>';
$this_counter ++;
$size --;
}
$this_counter = 0;
$return = '<select id="jform_params_' . $id . '" name="jform[params][' . $name . ']" >' .  $options . '</select>';
return $return;
}
}
?>

where is your xml file?