Open subform with repetable rows
Add some rows (3 or more)
We have elements in rows with Unique IDs (e.g. 1-jform_formfields_onoff, 2-jform_formfields_onoff, 3-jform_formfields_onoff, 4-jform_formfields_onoff)
Delete first row
Now we have elements in rows with IDs (e.g. 2-jform_formfields_onoff, 3-jform_formfields_onoff, 4-jform_formfields_onoff)
Click top button "Add row"
Unique ID in rows elements (e.g. 2-jform_formfields_onoff, 3-jform_formfields_onoff, 4-jform_formfields_onoff, 5-jform_formfields_onoff)
Not unique ID in rows elements (e.g. 2-jform_formfields_onoff, 2-jform_formfields_onoff, 3-jform_formfields_onoff, 4-jform_formfields_onoff)
New row added after first row and his elements have same ID as elements in first row.
And If elements has type Radio and have identical IDs, I can change only one element from two.
My extension is use this functional of Joomla and this problem is very important for my extension users
php 7.2
Joomla 3.7.2
MySQL 5.6.34
Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
Category | ⇒ | com_fields JavaScript |
Yes, I looked #15187, and my issue is a bit different.
This is xml of my extention:
`
<files>
<filename module="mod_ajax_webfactor_form">mod_ajax_webfactor_form.php</filename>
<filename>helper.php</filename>
<folder>tmpl</folder>
</files>
<languages>
</languages>
<updateservers>
<server type="extension" priority="1" name="mod_ajax_webfactor_form">http://webors.in.ua/ext_update/ajax_webfactor_form/mod_ajax_webfactor_form-update.xml</server>
</updateservers>
<config>
<fields name="params">
<fieldset name="basic">
<field name="list_fields"
type="Repeatable"
icon="list"
description=""
label="MODULE_AJAX_WEBFACTOR_FORM_LIST_FIELD_LABEL"
default="{
'namefield':['Name','Phone'],
'nameforpost':['Name','Phone'],
'typefield':['text','text'],
'paramsfield':['',''],
'sortnumber':['0','1'],
'required':['yes','yes'],
'onoff':['yes','yes']
}">
<fields name="formfields">
<fieldset
hidden="true"
name="list_fields_modal"
repeat="true">
<field
name="namefield"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_TITLE_FIELD_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TITLE_FIELD_DESC"
class="my-class"/>
<field
name="nameforpost"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_TITLE_FIELD_FOR_MESSAGE_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TITLE_FIELD_FOR_MESSAGE_DESC"
class="my-class"/>
<field
name="typefield"
type="list"
default="Select type"
label="MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_DESC">
<option value="text">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_TEXT</option>
<option value="textarea">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_TEXTAREA</option>
<option value="telephone">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_TELEPHONE</option>
<option value="email">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_EMAIL</option>
<option value="select">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_SELECT</option>
<option value="radio">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_RADIO</option>
<option value="checkbox">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_CHECKBOX</option>
<option value="color">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_COLOR</option>
<option value="hidden">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_HIDDEN</option>
<option value="separate">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_SEPARATE</option>
<option value="htmltagstart">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_HTML_TAG_START</option>
<option value="htmltagfinish">MODULE_AJAX_WEBFACTOR_FORM_TYPE_FIELD_HTML_TAG_FINISH</option>
</field>
<field
name="paramsfield"
label="MODULE_AJAX_WEBFACTOR_FORM_FIELD_PARAMETERS_LABEL"
size="30"
type="textarea"
description=""
default=""
class="my-class"/>
<field
name="sortnumber"
type="number"
class="poryadok"
size="2"
default="0"
label="MODULE_AJAX_WEBFACTOR_FORM_SORT_NUMBER_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_SORT_NUMBER_DESC"
min="0"
max="99"
step="1" />
<field
name="required"
type="radio"
default="no"
label="MODULE_AJAX_WEBFACTOR_FORM_REQUIRED_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_REQUIRED_DESC">
<option value="yes">MODULE_AJAX_WEBFACTOR_FORM_YES_LABEL</option>
<option value="no">MODULE_AJAX_WEBFACTOR_FORM_NO_LABEL</option>
</field>
<field
name="onoff"
type="radio"
default="yes"
label="MODULE_AJAX_WEBFACTOR_FORM_ONOFF_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_ONOFF_DESC">
<option value="yes">MODULE_AJAX_WEBFACTOR_FORM_YES_LABEL</option>
<option value="no">MODULE_AJAX_WEBFACTOR_FORM_NO_LABEL</option>
</field>
</fieldset>
</fields>
</field>
<field
name="nameInOut"
type="radio"
default="1"
label="MODULE_AJAX_WEBFACTOR_FORM_NAME_INPUT_INOUT_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_NAME_INPUT_INOUT_DESC"
class="radio btn-group btn-group-yesno popup-yes-no">
<option value="1" >MODULE_AJAX_WEBFACTOR_FORM_NAME_INPUT_INOUT_IN</option>
<option value="0">MODULE_AJAX_WEBFACTOR_FORM_NAME_INPUT_INOUT_OUT</option>
</field>
<field
name="popup"
type="radio"
default="1"
label="MODULE_AJAX_WEBFACTOR_FORM_POPUP_ENABLE_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_POPUP_ENABLE_DESC"
class="radio btn-group btn-group-yesno popup-yes-no">
<option value="1" >MODULE_AJAX_WEBFACTOR_FORM_POPUP_ON</option>
<option value="0">MODULE_AJAX_WEBFACTOR_FORM_POPUP_OFF</option>
</field>
<field
name="textcallpopup"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_CALL_POPUP_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_CALL_POPUP_DESC"
default="Call POPup form"
class="call-popup"/>
<field
name="textbeforeCallButton"
type="editor"
width="300"
height="350"
filter="raw"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_BEFORE_BUTTON_CALL_FORM_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_BEFORE_BUTTON_CALL_FORM_DESC"
required="false"
class="my-class"/>
<field
name="sendtoemail"
type="email"
label="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_FIELD_RECIPIENT_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_FIELD_RECIPIENT_DESC"
required="true"
class="my-class"/>
<field
name="sendtoemailcc"
type="email"
label="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_FIELD_RECIPIENT_CC_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_FIELD_RECIPIENT_CC_DESC"
required="false"
class="my-class"/>
<field
name="sendtoemailbcc"
type="email"
label="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_FIELD_RECIPIENT_BCC_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_FIELD_RECIPIENT_BCC_DESC"
required="false"
class="my-class"/>
<field
name="subjectofmail"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_SUBJECT_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_SUBJECT_DESC"
required="false"
class="my-class"/>
<field
name="textbeforeform"
type="editor"
width="300px"
height="350"
filter="raw"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_BEFORE_FORM_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_BEFORE_FORM_DESC"
required="false"
class="my-class"/>
<field
name="textsubmit"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_SUBMIT_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_SUBMIT_DESC"
default="Send Form"
required="true"
class="my-class"/>
<field
name="textwhensending"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_WHEN_SENDING_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_WHEN_SENDING_DESC"
default="Sending..."
required="false"
class="my-class"/>
<field
name="textsuccesssend"
type="editor"
width="300px"
height="350"
filter="raw"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_SUCCESS_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_SUCCESS_DESC"
default="Thanks for you."
required="true"
class="my-class"/>
</fieldset>
<fieldset name="MODULE_AJAX_WEBFACTOR_FORM_SECONDARY_PARAMS">
<field
name="textbeforemassage"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_TEXT_BEFORE_MESSAGE_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_TEXT_BEFORE_MESSAGE_DESC"
default=""
class="my-class"/>
<field
name="sendfromemail"
type="email"
label="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_SENDER_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_EMAIL_SENDER_DESC"
required="false"
class="my-class"/>
<field
name="sendfromname"
type="text"
label="MODULE_AJAX_WEBFACTOR_FORM_NAME_SENDER_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_NAME_SENDER_DESC"
required="false"
class="my-class"/>
<field
name="stylescheme"
type="list"
disabled="true"
label="MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_DESC">
<option value="default">MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_DEFAULT</option>
<option value="blue">MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_STYLE1</option>
<option value="green">MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_STYLE2</option>
<option value="red">MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_STYLE3</option>
<option value="yellow">MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_STYLE4</option>
<option value="brown">MODULE_AJAX_WEBFACTOR_FORM_STYLE_SCHEME_STYLE5</option>
</field>
<field
name="colorscheme"
type="list"
default="MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_SELECT_SCHEME"
label="MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_DESC">
<option value="default">MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_DEFAULT</option>
<option value="blue">MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_BLUE</option>
<option value="green">MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_GREEN</option>
<option value="red">MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_RED</option>
<option value="yellow">MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_YELLOW</option>
<option value="brown">MODULE_AJAX_WEBFACTOR_FORM_COLOR_SCHEME_BROWN</option>
</field>
<field
name="jsbeforesend"
label="MODULE_AJAX_WEBFACTOR_FORM_BEFORE_SEND_CODE_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_BEFORE_SEND_CODE_DESC"
size="30"
type="textarea"
default=""
filter="raw"
class="before-send"/>
<field
name="spinecode"
label="MODULE_AJAX_WEBFACTOR_FORM_SPINE_CODE_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_SPINE_CODE_DESC"
size="30"
type="textarea"
default=""
filter="raw"
class="ga-spine"/>
<field
name="clearaftersend"
type="radio"
default="0"
label="MODULE_AJAX_WEBFACTOR_FORM_ONOFF_CLEAR_AFTER_SEND_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_ONOFF_CLEAR_AFTER_SEND_DESC"
class="radio btn-group btn-group-yesno popup-yes-no">
<option value="1" >MODULE_AJAX_WEBFACTOR_FORM_ON_LABEL</option>
<option value="0">MODULE_AJAX_WEBFACTOR_FORM_OFF_LABEL</option>
</field>
<field
name="onoffjquery"
type="radio"
default="0"
label="MODULE_AJAX_WEBFACTOR_FORM_ONOFF_JQUERY_LABEL"
description="MODULE_AJAX_WEBFACTOR_FORM_ONOFF_JQUERY_DESC"
class="radio btn-group btn-group-yesno popup-yes-no">
<option value="1" >MODULE_AJAX_WEBFACTOR_FORM_ON_LABEL</option>
<option value="0">MODULE_AJAX_WEBFACTOR_FORM_OFF_LABEL</option>
</field>
</fieldset>
<fieldset name="advanced">
<field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_MODULE_LAYOUT_DESC"/>
<field name="moduleclass_sfx" type="text" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"/>
<field name="cache" type="list" label="COM_MODULES_FIELD_CACHING_LABEL"
description="COM_MODULES_FIELD_CACHING_DESC" default="1">
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
<option value="1">JGLOBAL_USE_GLOBAL</option>
</field>
</fieldset>
</fields>
</config>
`
Title |
|
I changed title post.
Category | com_fields JavaScript | ⇒ | Fields JavaScript |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-12-22 20:46:36 |
Closed_By | ⇒ | brianteeman |
Duplicate #15187 ?