Automatische Post -Back -Methode veränderte die obligatorische FeldprüfungC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Automatische Post -Back -Methode veränderte die obligatorische Feldprüfung

Post by Anonymous »

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.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post