Validatoren wurden auch auf Kalender übertragen
This commit is contained in:
@@ -107,11 +107,11 @@
|
||||
<div class="col-12" id="cont4">
|
||||
<div class="col-12" id="container2" style="margin-left:2px">
|
||||
<asp:Label ID="lbl_von" runat="server" Text="Von:"></asp:Label>
|
||||
<asp:TextBox id="pickdate1" Type="Date" ClientValidationFunction="validate" CssClass="classTarget" OnTextChanged="pickdate1_TextChanged" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidatorvon" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate1" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ValidateEmptyText="false" ClientValidationFunction=""></asp:CustomValidator>
|
||||
<asp:TextBox id="pickdate1" Type="Date" CssClass="classTarget" requiered="true" runat="server"></asp:TextBox>
|
||||
<!--<asp:RequiredFieldValidator ID="RequiredFieldValidatorvon" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate1" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator>
|
||||
<asp:CustomValidator ValidateEmptyText="false" ClientValidationFunction="instantValidation"></asp:CustomValidator> -->
|
||||
<asp:Label ID="lbl_bis" runat="server" Text="Bis:"></asp:Label>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidatorbis" ClientValidationFunction="validate" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate2" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator>
|
||||
<!-- <asp:RequiredFieldValidator ID="RequiredFieldValidatorbis" ClientValidationFunction="validate" runat="server" ErrorMessage="Field required" ControlToValidate="pickdate2" Text="Required" ForeColor="White" Font-Strikeout="False" Font-Underline="False" Font-Overline="False" Font-Bold="True" BackColor="Red"></asp:RequiredFieldValidator> -->
|
||||
<asp:TextBox id="pickdate2" Type="Date" CssClass="classTarget" OnTextChanged="pickdate2_TextChanged" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
<div id="Abstand"></div>
|
||||
@@ -221,34 +221,20 @@
|
||||
var el = $(ele).closest('label').text();
|
||||
if (el == "Alle") {
|
||||
$("#container2").show();
|
||||
$("#pickdate1").text = "01." + Date.now.MM.toString + "." +Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
$("#pickdate2").text = Date.now.dd.toString + "." + Date.now.MM.toString + "." Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorvon.ClientID %>'), true);
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorbis.ClientID %>'), true);
|
||||
var date1 = document.getElementById('<%=pickdate1.ClientID%>')
|
||||
var date2 = document.getElementById('<%=pickdate2.ClientID%>')
|
||||
date1.attributes.required = true
|
||||
date2.attributes.required = true
|
||||
dat
|
||||
} else if (el == "Alle_M") {
|
||||
$("#container2").show();
|
||||
$("#pickdate1").text = "01." + Date.now.MM.toString + "." + Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
$("#pickdate2").text = Date.now.dd.toString + "." + Date.now.MM.toString + "." Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorvon.ClientID %>'), true);
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorbis.ClientID %>'), true);
|
||||
} else if (el == "Freigabe") {
|
||||
$("#container2").show();
|
||||
$("#pickdate1").text = "01." + Date.now.MM.toString + "." + Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
$("#pickdate2").text = Date.now.dd.toString + "." + Date.now.MM.toString + "." Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorvon.ClientID %>'), true);
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorbis.ClientID %>'), true);
|
||||
} else if (el == "Freigabe_M") {
|
||||
$("#container2").show();
|
||||
$("#pickdate1").text = "01." + Date.now.MM.toString + "." + Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
$("#pickdate2").text = Date.now.dd.toString + "." + Date.now.MM.toString + "." Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorvon.ClientID %>'), true);
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorbis.ClientID %>'), true);
|
||||
date1.attributes.required = true
|
||||
date2.attributes.required = true
|
||||
|
||||
} else {
|
||||
$("#container2").hide();
|
||||
$("#pickdate1").text = "01." + Date.now.MM.toString + "." + Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
$("#pickdate2").text = Date.now.dd.toString + "." + Date.now.MM.toString + "." Date.now.yyyy.toString + " " + Date.now.hh.toString + ":" + Date.now.MM.toString + ":" + Date.now.yyyy.toString;
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorvon.ClientID %>'), false);
|
||||
ValidatorEnable(document.getElementById('<%=RequiredFieldValidatorbis.ClientID %>'), false);
|
||||
date1.attributes.required = false
|
||||
date2.attributes.required = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -261,13 +247,7 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var v1 = Date.parse(document.getElementById("pickdate1").text);
|
||||
var v2 = Date.parse(document.getElementById("pickdate2").text);
|
||||
|
||||
If(compareDate(v1)==false) {
|
||||
alert("Datum nicht im gültigen Rahmen!");
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function compareDate(str1, str2){
|
||||
@@ -282,7 +262,4 @@
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
alert(window.frame1.zipphone1_1)
|
||||
</script>
|
||||
</asp:Content>
|
||||
@@ -427,16 +427,16 @@ Partial Class Kundenbereich_Default
|
||||
End Sub
|
||||
|
||||
Protected Sub pickdate1_TextChanged(sender As Object, e As EventArgs)
|
||||
Dim TB As TextBox = sender
|
||||
Dim TB As TextBox = pickdate1
|
||||
If TB.Text = "" Then
|
||||
TB.Attributes.Add("Border", "2px solid red")
|
||||
pickdate1.BorderColor = Drawing.Color.Red
|
||||
Else
|
||||
TB.Attributes.Add("Border", "None")
|
||||
pickdate1.BorderStyle = 1
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub pickdate2_TextChanged(sender As Object, e As EventArgs)
|
||||
Dim TB As TextBox = sender
|
||||
Dim TB As TextBox = pickdate2
|
||||
If TB.Text = "" Then
|
||||
TB.Attributes.Add("Border", "2px solid red")
|
||||
Else
|
||||
|
||||
@@ -619,7 +619,7 @@
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(document.ready(function () {
|
||||
$(document.ready(() {
|
||||
var x = window.frame1.zipphone1_1;
|
||||
alert(x);
|
||||
var y = window.frame1.zipphone1_2;
|
||||
@@ -632,8 +632,7 @@
|
||||
alert(y);
|
||||
var z = window.frame1.zipphone2_3;
|
||||
alert(z);
|
||||
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user