I need help populating the selected saved item into the form control.
<select class="form-control">
<option data-parameter-id="685" data-parent-id="1052" data-aggregation-id="null" data-aggregation-parameter="null">ABC</option>
<option data-parameter-id="993" data-parent-id="0" data-aggregation-id="43" data-aggregation-parameter="2">DEF</option>
<option data-parameter-id="993" data-parent-id="0" data-aggregation-id="39" data-aggregation-parameter="null">XYZ</option>
<select>
My goal is to select the appropriate option when I receive an external input specifying certain parameters.
var savedOrderedAttributeId = $('#ordered-attribute-id').val();
var savedOrderedAttributeAggregationId = $('#ordered-aggregation-id').val();
var selectorForOptionWithSavedParameter = '"select"'+ ' option[data-aggregation-id="' + savedOrderedAttributeAggregationId + '"' + 'data-parameter-id="' + savedOrderedAttributeId + '"]';
$(controlSelector).find("select").val($(controlSelector).find(selectorForOptionWithSavedParameter).val());
What modifications should be made in the code to achieve selection based on both parameters?