Wednesday, 15 May 2013

jquery - multiple custom fields using xml in joomla -



jquery - multiple custom fields using xml in joomla -

i need create custom fields using xml in module in joomla 3.0. did somethething this, shown below. mod_category.xml file code fields :

<fields name="params"> <fieldset name="protection" addfieldpath="/modules/mod_careercategory/include/" label="tagelement"> <field name="headertitle" type="text" default="" label="header_title" description="header_title_desc"/> <field name="title" type="tagelements" label="title" id="title"/> </fieldset> </fields>

and tagelements.php code :

jimport('joomla.form.formfield'); class jformfieldtagelements extends jformfield { protected $type = 'tagelements'; //the form field type protected function getinput() { homecoming '<input type="text" name="'.$this->name.'" id="'.$this->id.'" label="title"/><br />'. '<input type="text" name="link" id="link" label="link"/><br />'. '<input type="text" name="order" id="order" label="order"/><br />'. '<input type="button" id="btnadd" name="addmore" value="add more"> <input type="button" id="btndel" value="remove" />'; }

i have 2 buttons, add together , remove, which, using jquery add together more of these fields when clicked. fields removed when remove button clicked.

when running code 4 text boxes displayed , 2 buttons. when save form value of first textbox stored in database.

i want of fields saved. can help me?

i believe custom form fields designed create single form field, won't expecting subsequent fields when form saved.

what work have main field ( 1 name "$this->name" ) hidden field, jquery populates other info on submit (probably in json format).

jquery xml joomla

No comments:

Post a Comment