Skip to content

Commit

Permalink
Fixing issue #12165: Unable to add more than drop-down field to an at…
Browse files Browse the repository at this point in the history
…tribute at a time
  • Loading branch information
mfavetti authored and c-schmitz committed Mar 3, 2017
1 parent 983668e commit 5111923
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions application/models/ParticipantAttributeName.php
Expand Up @@ -421,6 +421,7 @@ function getAttributesValues($attribute_id = null)
->select('*')
->from('{{participant_attribute_values}}')
->where('attribute_id = :attribute_id')
->order('value_id ASC')
->bindParam(":attribute_id", $attribute_id, PDO::PARAM_INT)
->queryAll();
}
Expand Down
Expand Up @@ -59,7 +59,7 @@
foreach($model->getAttributesValues($model->attribute_id) as $attribute_value){
echo "<div class='control-group'>";
echo "<div class='dropDownContainer col-xs-8 col-offset-xs-2'>";
echo "<input class='form-control' name='ParticipantAttributeNamesDropdown[".$attribute_value['value_id']."]' value='".$attribute_value['value']."' />";
echo "<input class='form-control' name='ParticipantAttributeNamesDropdown[]' value='".$attribute_value['value']."' />";
echo "</div>";
echo '<div class="col-xs-1">
<button class="btn btn-default form-group action_delDropdownField">
Expand Down Expand Up @@ -172,13 +172,12 @@
});
jQuery('#addDropdownField').on('click', function(e){
e.preventDefault();
var count_id = ($('#ParticipantAttributeNamesDropdownEditList').find('div.dropdownOptionContainer').length)+1;
jQuery('#dummyDropdownInputGroup')
.clone()
.appendTo($('#ParticipantAttributeNamesDropdownEditList'))
.find('input.selector_dropDownValue')
.attr('name', 'ParticipantAttributeNamesDropdown[]')
.attr('id', 'ParticipantAttributeNamesDropdown_'+count_id);
.removeAttr('id')
.find('input')
.attr('name', 'ParticipantAttributeNamesDropdown[]');
return false;
});
jQuery('#addLanguageField').on('click', function(e){
Expand Down

0 comments on commit 5111923

Please sign in to comment.