Ich habe den folgenden Java -Skript -Code für ein obligatorisches Eingabefeld. < /p>
$('#directorModal').on('show.bs.modal', function () {
// Add an event listener for the 'toDate' field
$('#txtDirectorEffectiveTo').on('input', function () {
var toDateValue = $(this).val(); // Get the value of the toDate field
console.log("toDateValue:", toDateValue);
if (toDateValue) {
$('#txtReasonForDischarge').prop('required', true); // Make txtReasonForDischarge required
} else {
$('#txtReasonForDischarge').prop('required', false); // Remove the required property
}
});
});
$('#directorModal').on('hidden.bs.modal', function () {
$('#txtReasonForDischarge').prop('required', false);
});
< /code>
Ich habe auch eine < /p>
Status
< /code>
Wenn kein Postback -Obligator -Feld gut funktioniert. Wenn ich jedoch den Wert des ddldirectorStatus -obligatorischen Feldes geändert habe, funktioniert das obligatorische Feld nicht ordnungsgemäß. Warum. Ich brauche eine Lösung für dieses Problem. Wo ich den Code oder eine andere alternative Lösung davon
ändern muss. Danke in Fortgeschrittene.
Ich habe den folgenden Java -Skript -Code für ein obligatorisches Eingabefeld. < /p>
$('#directorModal').on('show.bs.modal', function () {
// Add an event listener for the 'toDate' field
$('#txtDirectorEffectiveTo').on('input', function () {
var toDateValue = $(this).val(); // Get the value of the toDate field
console.log("toDateValue:", toDateValue);
if (toDateValue) {
$('#txtReasonForDischarge').prop('required', true); // Make txtReasonForDischarge required
} else {
$('#txtReasonForDischarge').prop('required', false); // Remove the required property
}
});
});
$('#directorModal').on('hidden.bs.modal', function () {
$('#txtReasonForDischarge').prop('required', false);
});
< /code>
Ich habe auch eine < /p>
Status
< /code>
Wenn kein Postback -Obligator -Feld gut funktioniert. Wenn ich jedoch den Wert des ddldirectorStatus -obligatorischen Feldes geändert habe, funktioniert das obligatorische Feld nicht ordnungsgemäß. Warum. Ich brauche eine Lösung für dieses Problem. Wo ich den Code oder eine andere alternative Lösung davon [url=viewtopic.php?t=12045]ändern[/url] muss. Danke in Fortgeschrittene.