Get element's id, containing colon
I have a function to parse all error fields before saving changes, I easily can get the text of error field labels, but I stuck on getting their ids, containing colons:
var x = ,
y = ;
$('div.has-error label.control-label').each(function(index, obj) {
x.push($(this).text());
y.push($(this).prop('id'));
});
console.log(y.join('~'));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="view:_id1:_id2:facetMiddle:ccSection3">
<div class="ccSectionPanel panel panel-default" id="pSection3">
<div style="cursor:pointer;" class="panel-heading" id="pSection3_heading" href="#pSection3_section" data-toggle="collapse">
<a id="view:_id1:_id2:facetMiddle:ccSection3:_id145" href="#" class="panel-title">Расположение</a></div>
<div class="panel-collapse collapse in" id="pSection3_section">
<div class="panel-body">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody">
<div class="form-horizontal">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" class="control-label col-xs-12 col-sm-4" id="fgPostCode_label">Индекс</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet">
<input type="number" value="107392" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" autocomplete="off" class="form-control"
placeholder="Индекс" min="100000" pattern="^d{6}$" max="999999" maxlength="6" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" class="control-label col-xs-12 col-sm-4" id="fgAddress_label">Адрес (юридический)</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet">
<input type="text" value="ул. Халтуринская, д.18" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" autocomplete="off" class="form-control"
placeholder="Адрес (юридический)" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" class="control-label col-xs-12 col-sm-4" id="fgDistrict_label">Округ</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" aria-labelledby="fgDistrict_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" value=""></div>
</div>
</div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" class="control-label col-xs-12 col-sm-4" id="fgArea_label">Район</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" aria-labelledby="fgArea_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" value=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
How can I get a list of id's, containing colons (to create links on error blocks)?
javascript jquery
add a comment |
I have a function to parse all error fields before saving changes, I easily can get the text of error field labels, but I stuck on getting their ids, containing colons:
var x = ,
y = ;
$('div.has-error label.control-label').each(function(index, obj) {
x.push($(this).text());
y.push($(this).prop('id'));
});
console.log(y.join('~'));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="view:_id1:_id2:facetMiddle:ccSection3">
<div class="ccSectionPanel panel panel-default" id="pSection3">
<div style="cursor:pointer;" class="panel-heading" id="pSection3_heading" href="#pSection3_section" data-toggle="collapse">
<a id="view:_id1:_id2:facetMiddle:ccSection3:_id145" href="#" class="panel-title">Расположение</a></div>
<div class="panel-collapse collapse in" id="pSection3_section">
<div class="panel-body">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody">
<div class="form-horizontal">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" class="control-label col-xs-12 col-sm-4" id="fgPostCode_label">Индекс</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet">
<input type="number" value="107392" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" autocomplete="off" class="form-control"
placeholder="Индекс" min="100000" pattern="^d{6}$" max="999999" maxlength="6" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" class="control-label col-xs-12 col-sm-4" id="fgAddress_label">Адрес (юридический)</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet">
<input type="text" value="ул. Халтуринская, д.18" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" autocomplete="off" class="form-control"
placeholder="Адрес (юридический)" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" class="control-label col-xs-12 col-sm-4" id="fgDistrict_label">Округ</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" aria-labelledby="fgDistrict_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" value=""></div>
</div>
</div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" class="control-label col-xs-12 col-sm-4" id="fgArea_label">Район</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" aria-labelledby="fgArea_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" value=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
How can I get a list of id's, containing colons (to create links on error blocks)?
javascript jquery
have you tried the dojo ? somehting like dojo.forEach(dojo.query("div.has-error label.control-label"),function(label){console.log(label.id);});
– umeli
Nov 14 '18 at 13:37
1
Not entirely clear which ID you need and what is wrong with they
array currently or what specific problem really is
– charlietfl
Nov 14 '18 at 13:45
IBM Domino uses old Dojo and it's not very compatible with the jQuery. I had the "y" array empty.
– Antiokh
Nov 28 '18 at 14:03
add a comment |
I have a function to parse all error fields before saving changes, I easily can get the text of error field labels, but I stuck on getting their ids, containing colons:
var x = ,
y = ;
$('div.has-error label.control-label').each(function(index, obj) {
x.push($(this).text());
y.push($(this).prop('id'));
});
console.log(y.join('~'));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="view:_id1:_id2:facetMiddle:ccSection3">
<div class="ccSectionPanel panel panel-default" id="pSection3">
<div style="cursor:pointer;" class="panel-heading" id="pSection3_heading" href="#pSection3_section" data-toggle="collapse">
<a id="view:_id1:_id2:facetMiddle:ccSection3:_id145" href="#" class="panel-title">Расположение</a></div>
<div class="panel-collapse collapse in" id="pSection3_section">
<div class="panel-body">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody">
<div class="form-horizontal">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" class="control-label col-xs-12 col-sm-4" id="fgPostCode_label">Индекс</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet">
<input type="number" value="107392" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" autocomplete="off" class="form-control"
placeholder="Индекс" min="100000" pattern="^d{6}$" max="999999" maxlength="6" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" class="control-label col-xs-12 col-sm-4" id="fgAddress_label">Адрес (юридический)</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet">
<input type="text" value="ул. Халтуринская, д.18" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" autocomplete="off" class="form-control"
placeholder="Адрес (юридический)" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" class="control-label col-xs-12 col-sm-4" id="fgDistrict_label">Округ</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" aria-labelledby="fgDistrict_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" value=""></div>
</div>
</div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" class="control-label col-xs-12 col-sm-4" id="fgArea_label">Район</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" aria-labelledby="fgArea_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" value=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
How can I get a list of id's, containing colons (to create links on error blocks)?
javascript jquery
I have a function to parse all error fields before saving changes, I easily can get the text of error field labels, but I stuck on getting their ids, containing colons:
var x = ,
y = ;
$('div.has-error label.control-label').each(function(index, obj) {
x.push($(this).text());
y.push($(this).prop('id'));
});
console.log(y.join('~'));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="view:_id1:_id2:facetMiddle:ccSection3">
<div class="ccSectionPanel panel panel-default" id="pSection3">
<div style="cursor:pointer;" class="panel-heading" id="pSection3_heading" href="#pSection3_section" data-toggle="collapse">
<a id="view:_id1:_id2:facetMiddle:ccSection3:_id145" href="#" class="panel-title">Расположение</a></div>
<div class="panel-collapse collapse in" id="pSection3_section">
<div class="panel-body">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody">
<div class="form-horizontal">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" class="control-label col-xs-12 col-sm-4" id="fgPostCode_label">Индекс</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet">
<input type="number" value="107392" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" autocomplete="off" class="form-control"
placeholder="Индекс" min="100000" pattern="^d{6}$" max="999999" maxlength="6" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" class="control-label col-xs-12 col-sm-4" id="fgAddress_label">Адрес (юридический)</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet">
<input type="text" value="ул. Халтуринская, д.18" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" autocomplete="off" class="form-control"
placeholder="Адрес (юридический)" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" class="control-label col-xs-12 col-sm-4" id="fgDistrict_label">Округ</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" aria-labelledby="fgDistrict_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" value=""></div>
</div>
</div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" class="control-label col-xs-12 col-sm-4" id="fgArea_label">Район</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" aria-labelledby="fgArea_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" value=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
How can I get a list of id's, containing colons (to create links on error blocks)?
var x = ,
y = ;
$('div.has-error label.control-label').each(function(index, obj) {
x.push($(this).text());
y.push($(this).prop('id'));
});
console.log(y.join('~'));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="view:_id1:_id2:facetMiddle:ccSection3">
<div class="ccSectionPanel panel panel-default" id="pSection3">
<div style="cursor:pointer;" class="panel-heading" id="pSection3_heading" href="#pSection3_section" data-toggle="collapse">
<a id="view:_id1:_id2:facetMiddle:ccSection3:_id145" href="#" class="panel-title">Расположение</a></div>
<div class="panel-collapse collapse in" id="pSection3_section">
<div class="panel-body">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody">
<div class="form-horizontal">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" class="control-label col-xs-12 col-sm-4" id="fgPostCode_label">Индекс</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet">
<input type="number" value="107392" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" autocomplete="off" class="form-control"
placeholder="Индекс" min="100000" pattern="^d{6}$" max="999999" maxlength="6" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" class="control-label col-xs-12 col-sm-4" id="fgAddress_label">Адрес (юридический)</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet">
<input type="text" value="ул. Халтуринская, д.18" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" autocomplete="off" class="form-control"
placeholder="Адрес (юридический)" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" class="control-label col-xs-12 col-sm-4" id="fgDistrict_label">Округ</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" aria-labelledby="fgDistrict_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" value=""></div>
</div>
</div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" class="control-label col-xs-12 col-sm-4" id="fgArea_label">Район</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" aria-labelledby="fgArea_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" value=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
var x = ,
y = ;
$('div.has-error label.control-label').each(function(index, obj) {
x.push($(this).text());
y.push($(this).prop('id'));
});
console.log(y.join('~'));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="view:_id1:_id2:facetMiddle:ccSection3">
<div class="ccSectionPanel panel panel-default" id="pSection3">
<div style="cursor:pointer;" class="panel-heading" id="pSection3_heading" href="#pSection3_section" data-toggle="collapse">
<a id="view:_id1:_id2:facetMiddle:ccSection3:_id145" href="#" class="panel-title">Расположение</a></div>
<div class="panel-collapse collapse in" id="pSection3_section">
<div class="panel-body">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody">
<div class="form-horizontal">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" class="control-label col-xs-12 col-sm-4" id="fgPostCode_label">Индекс</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet">
<input type="number" value="107392" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgPostCode:fieldFacet:NumberPostCode" autocomplete="off" class="form-control"
placeholder="Индекс" min="100000" pattern="^d{6}$" max="999999" maxlength="6" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress">
<div class="form-group required">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" class="control-label col-xs-12 col-sm-4" id="fgAddress_label">Адрес (юридический)</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet">
<input type="text" value="ул. Халтуринская, д.18" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgAddress:fieldFacet:TextAddress" autocomplete="off" class="form-control"
placeholder="Адрес (юридический)" required=""></div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" class="control-label col-xs-12 col-sm-4" id="fgDistrict_label">Округ</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" aria-labelledby="fgDistrict_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict:fieldFacet:ComboDistrict" value=""></div>
</div>
</div>
</div>
</div>
</div>
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea">
<div class="form-group required has-error has-danger">
<label for="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" class="control-label col-xs-12 col-sm-4" id="fgArea_label">Район</label>
<div class="col-xs-12 col-sm-8">
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet">
<div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox dijitValidationTextBox" id="widget_view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" role="combobox" aria-haspopup="true" data-dojo-attach-point="_popupStateNode"
lang="ru" widgetid="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" aria-labelledby="fgArea_label" style="">
<div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="▼ " type="text" tabindex="-1" readonly="readonly" role="button presentation" aria-hidden="true" required=""></div>
<div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="Χ " type="text" tabindex="-1" readonly="readonly" role="presentation" required=""></div>
<div class="dijitReset dijitInputField dijitInputContainer"><input class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" role="textbox" aria-required="true" tabindex="0" id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea"
value="" aria-invalid="false" required=""><input type="hidden" name="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgArea:fieldFacet:ComboArea" value=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
javascript jquery
javascript jquery
edited Nov 14 '18 at 15:11
connexo
21.8k73557
21.8k73557
asked Nov 14 '18 at 12:47
AntiokhAntiokh
386
386
have you tried the dojo ? somehting like dojo.forEach(dojo.query("div.has-error label.control-label"),function(label){console.log(label.id);});
– umeli
Nov 14 '18 at 13:37
1
Not entirely clear which ID you need and what is wrong with they
array currently or what specific problem really is
– charlietfl
Nov 14 '18 at 13:45
IBM Domino uses old Dojo and it's not very compatible with the jQuery. I had the "y" array empty.
– Antiokh
Nov 28 '18 at 14:03
add a comment |
have you tried the dojo ? somehting like dojo.forEach(dojo.query("div.has-error label.control-label"),function(label){console.log(label.id);});
– umeli
Nov 14 '18 at 13:37
1
Not entirely clear which ID you need and what is wrong with they
array currently or what specific problem really is
– charlietfl
Nov 14 '18 at 13:45
IBM Domino uses old Dojo and it's not very compatible with the jQuery. I had the "y" array empty.
– Antiokh
Nov 28 '18 at 14:03
have you tried the dojo ? somehting like dojo.forEach(dojo.query("div.has-error label.control-label"),function(label){console.log(label.id);});
– umeli
Nov 14 '18 at 13:37
have you tried the dojo ? somehting like dojo.forEach(dojo.query("div.has-error label.control-label"),function(label){console.log(label.id);});
– umeli
Nov 14 '18 at 13:37
1
1
Not entirely clear which ID you need and what is wrong with the
y
array currently or what specific problem really is– charlietfl
Nov 14 '18 at 13:45
Not entirely clear which ID you need and what is wrong with the
y
array currently or what specific problem really is– charlietfl
Nov 14 '18 at 13:45
IBM Domino uses old Dojo and it's not very compatible with the jQuery. I had the "y" array empty.
– Antiokh
Nov 28 '18 at 14:03
IBM Domino uses old Dojo and it's not very compatible with the jQuery. I had the "y" array empty.
– Antiokh
Nov 28 '18 at 14:03
add a comment |
1 Answer
1
active
oldest
votes
You can get attribute "id" of that element,
Please check fiddle I made for you.
https://jsfiddle.net/p1c0s45r/1/
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict"></div>
<span></span>
$(document).ready(function() {
$('span').html($('div').attr('id'));
});
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300617%2fget-elements-id-containing-colon%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can get attribute "id" of that element,
Please check fiddle I made for you.
https://jsfiddle.net/p1c0s45r/1/
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict"></div>
<span></span>
$(document).ready(function() {
$('span').html($('div').attr('id'));
});
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
add a comment |
You can get attribute "id" of that element,
Please check fiddle I made for you.
https://jsfiddle.net/p1c0s45r/1/
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict"></div>
<span></span>
$(document).ready(function() {
$('span').html($('div').attr('id'));
});
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
add a comment |
You can get attribute "id" of that element,
Please check fiddle I made for you.
https://jsfiddle.net/p1c0s45r/1/
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict"></div>
<span></span>
$(document).ready(function() {
$('span').html($('div').attr('id'));
});
You can get attribute "id" of that element,
Please check fiddle I made for you.
https://jsfiddle.net/p1c0s45r/1/
<div id="view:_id1:_id2:facetMiddle:ccSection3:panelBody:fgDistrict"></div>
<span></span>
$(document).ready(function() {
$('span').html($('div').attr('id'));
});
answered Nov 14 '18 at 14:47
Love BuddhaLove Buddha
907
907
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
add a comment |
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
Thank you, I'll try. I've changed the logic, gettin' parentNodes and collectin' their id's. I need something to jump from the list of invalidated fields and decided to jump on a parent container.
– Antiokh
Nov 28 '18 at 14:00
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300617%2fget-elements-id-containing-colon%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
have you tried the dojo ? somehting like dojo.forEach(dojo.query("div.has-error label.control-label"),function(label){console.log(label.id);});
– umeli
Nov 14 '18 at 13:37
1
Not entirely clear which ID you need and what is wrong with the
y
array currently or what specific problem really is– charlietfl
Nov 14 '18 at 13:45
IBM Domino uses old Dojo and it's not very compatible with the jQuery. I had the "y" array empty.
– Antiokh
Nov 28 '18 at 14:03