Wirkung: Formdatum - Alter = erforderlicher Testtermin!
Ereignis:
Das Ereignis wird ausgelöst, wenn das geformte Datumstextfeld geändert wird!
Das Ereignis wird ausgelöst, wenn das Textfeld „Alter“ geändert wird!
Code:
(Erklärung: Formdatum-ID: tbcxrq Alters-ID: tblq Erforderliches Testdatum-ID: tbyqsyrq)
Kopieren Sie den Codecode wie folgt:
<script type="text/javascript">
$(Funktion() {
$("#<%=tbcxrq.ClientID %>").change(function() { CaclDate(); });
$("#<%=tblq.ClientID %>").change(function() { CaclDate(); });
//Testzeit basierend auf dem Alter berechnen
Funktion CaclDate() {
if ($("#<%=tblq.ClientID %>").val() == "" || $("#<%=tbcxrq.ClientID %>").val() == "") {
$("#<%=tbyqsyrq.ClientID %>").val("");
}
anders {
var MoldingDate = $("#<%=tbcxrq.ClientID %>").val();
MoldingDate = MoldingDate.replace("-", "/")
var d = neues Datum(MoldingDate);
var AgeDate = $("#<%=tblq.ClientID %>").val();
d.setDate(d.getDate() + parseInt(AgeDate));
var Monat = d.getMonth() + 1;
if (parseInt(month) < 10)
Monat = „0“ + Monat;
var day = d.getDate();
if (parseInt(day) < 10)
Tag = „0“ + Tag;
var date = (d.getFullYear()) + „-“ + Monat + „-“ + Tag;
$("#<%=tbyqsyrq.ClientID %>").val(date);
}
}
});
</script>