RadioButtons können trotz styling ausgewählt werden und das DIV verschwindet bei nichtanwahl von Alle oder Freigabe

This commit is contained in:
ja
2021-09-21 10:45:22 +02:00
parent 4dd530cfbc
commit 51fc862997

View File

@@ -78,12 +78,12 @@
<div class="d-none d-md-block">
<div style=" width:780px; margin-left:8px">
<asp:RadioButtonList id="RadioButtonList1" runat="server" RepeatDirection="Horizontal" style="border-color:#fff">
<asp:ListItem ID="rbt_Alle" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:0px"><span style="margin-left:3px;">Alle</span></asp:ListItem>
<asp:ListItem ID="rbt_Erf" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:4px"><span name="Erfasst" style="margin-left:3px;">Erfasst</span></asp:ListItem>
<asp:ListItem ID="rbt_Alle" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:0px"><label id="lbl_rbt_Alle" for="rbt_Alle">Alle</label></asp:ListItem>
<asp:ListItem ID="rbt_Erf" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:4px"><span for="rbt_Erf" style="margin-left:3px;">Erfasst</span></asp:ListItem>
<asp:ListItem ID="rbt_Vorb" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:4px"><span style="margin-left:3px;">Vorbereitet</span></asp:ListItem>
<asp:ListItem ID="rbt_Vorg" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:4px"><span style="margin-left:3px;">Vorgeschrieben</span></asp:ListItem>
<asp:ListItem ID="rbt_Ankunft" GroupName="radios" style="font-size:/*17px*/1.063em;margin-left:4px"><span style="margin-left:3px;">Ankunft</asp:ListItem>
<asp:ListItem ID="rbt_Freig" GroupName="radios" data-bs-toggle="tooltip" data-bs-placement="top" title="Wenn dieser Filter angewählt ist, bitte das Datum eingrenzen." style="font-size:/*17px*/1.063em;margin-left:4px"><label style="margin-left:3px;">Freigabe</label></asp:ListItem>
<asp:ListItem ID="rbt_Freig" GroupName="radios" data-bs-toggle="tooltip" data-bs-placement="top" title="Wenn dieser Filter angewählt ist, bitte das Datum eingrenzen." style="font-size:/*17px*/1.063em;margin-left:4px"><label>Freigabe</label></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
@@ -227,26 +227,31 @@
});
</script>
<script type='text/javascript'>
$(document).ready(function () {
$(document).ready(function () {
$("#container2").hide();
$('#<%=RadioButtonList1.ClientID %> input[type="radio"]').change(function () {
if ($(this).val() == HTMLSpanElement.val() == "Freigabe") {
$("#container2").show();
} else if ($(this).val() == HTMLSpanElement.val() == "Alle") {
$("#container2").show();
} else {
$("#container2").hide();
}
$('#<%=RadioButtonList1.ClientID %> input[type="radio"]').change(function () {
var idVal = $(this).attr("id");
alert($("label[for='" + idVal + "']").text());
if ($("label[for='" + idVal + "']").text() == "Alle"){
$("#container2").show();
} else if ($("label[for='" + idVal + "']").text() == "Freigabe") {
$("#container2").show();
} else {
$("#container2").hide();
}
});
$('#<%=RadioButtonList2.ClientID %> input[type="radio"]').change(function () {
if ($(this).val() == HTMLSpanElement.val()=="Freigabe") {
var idVal = $(this).attr("id");
alert($("label[for='" + idVal + "']").text());
if ($("label[for='" + idVal + "']").text() == "Alle") {
$("#container2").show();
} else if ($(this).val == HTMLSpanElement.val() == "Alle") {
} else if ($("label[for='" + idVal + "']").text() == "Freigabe") {
$("#container2").show();
} else {
$("#container2").hide();
}
});
});
</script>
</asp:Content>