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:File: /administrator/components/com_mycomponent/models/forms/history.xml<form><fields addfieldpath="/administrator/components/com_mycomponent/models/fields"><fieldname="id"type="hidden"default="0"required="true"readonly="true"/><fieldid="someid"name="someid"type="City"label="City"description="Choose City"required="true" /></fields></form>File: /administrator/components/com_mycomponent/models/fields/history.php<?phpdefined('_JEXEC') or die('Restricted access');jimport('joomla.form.formfield');
class JFormFieldCity extends JFormField {protected $type = 'City';// getLabel() left outpublic function getInput() {return '<select id="'.$this->id.'" name="'.$this->name.'"> <option value="1">City 1</option> </select>';}}And that is all i have changed. I use this tutorial: http://docs.joomla.org/Creating_a_custom_form_field_type (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? (this code outputs just input field, and when i change value and save it, i can see that it is not saved in database).--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.