function checkfields () {< /p>
Код: Выделить всё
var fields = \["TextField1", "TextField2", "Dropdown1"\]; // List of required fields
var button = this.getField("SubmitButton"); // The button to enable/disable
var allFilled = true; // Flag to track if all fields are filled
// Loop through each required field
for (var i = 0; i \< fields.length; i++) {
var field = this.getField(fields\[i\]);
// Check if the field is empty or not filled
if (!field.value || field.value.trim() === "") {
allFilled = false; // Set to false if any field is empty
break;
}
}
// Enable or disable the button based on whether all fields are filled
button.readonly = !allFilled; // Disable the button if fields are not filled
// Прикрепить функцию контроля к необходимым полям
var fieldstomonitor = ["textfield1" , "Textfield2", "Dropdown1"]; < /p>
for (var i = 0; i
Код: Выделить всё
this.getField(fieldsToMonitor\[i\]).setAction("OnBlur", "checkFields();");
// Запуск загрузки «Загрязнить в форме», чтобы отключить кнопку изначально
CheckFields () ;
Подробнее здесь: https://stackoverflow.com/questions/794 ... llable-pdf
Мобильная версия