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

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Automatische Post -Back -Methode veränderte die obligatorische Feldprüfung

by Anonymous » 17 Feb 2025, 08:02

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.

Top