title: Joomla 2.5 custom form field type
body: <p>I am developing Joomla component, and i need custom form field type (Joomla 2.5) in admin area, but i have problem... It just won't work. Here is what i done so far:</p>
  
  <p>File: /administrator/components/com_mycomponent/models/forms/history.xml</p>
  
  <pre><code>&lt;form&gt;
  
      &lt;fields addfieldpath="/administrator/components/com_mycomponent/models/fields"&gt;
  
          &lt;field
              name="id"
              type="hidden"
              default="0"
              required="true"
              readonly="true"/&gt;                           
  
          &lt;field 
              id="someid" 
              name="someid" 
              type="City" 
              label="City"
              description="Choose City"
              required="true" /&gt;
  
      &lt;/fields&gt;   
  
  &lt;/form&gt;
  </code></pre>
  
  <p>File: /administrator/components/com_mycomponent/models/fields/history.php</p>
  
  <pre><code>&lt;?php
  defined('_JEXEC') or die('Restricted access');
  
  jimport('joomla.form.formfield');
  
  class JFormFieldCity extends JFormField {
  
          protected $type = 'City';
  
          // getLabel() left out
  
          public function getInput() {
  
              return '&lt;select id="'.$this-&gt;id.'" name="'.$this-&gt;name.'"&gt;  &lt;option value="1"&gt;City 1&lt;/option&gt; &lt;/select&gt;';
          }
  }
  </code></pre>
  
  <p>And that is all i have changed. I use this tutorial: <a href="http://docs.joomla.org/Creating_a_custom_form_field_type" rel="nofollow">http://docs.joomla.org/Creating_a_custom_form_field_type</a> (it is for Joomla 1.6, and i cant find anything "fresh"). Can someone tell me if i need more code somewhere or is something wrong with this code?</p>
  
  <p>EDIT: i forgot to mention that this code outputs just input field.</p>