You can set the selectedIndex property to change the value of a dropdown list. It takes a 0-based integer to select the nth item from the dropdown list. // Select the third item
DropdownList.selectedIndex = 2;
You can use FormCalcs Date2Num() method to convert a date into a number and Num2Date for the other way. Here an example:var nStartDate = Date2Num(Datefield1.formattedValue, "MM/DD/YYYY")
var nAddDays = ProjectLengthField.rawValue
var nEndDate = Sum(nStartDate, nAddDays)
DateField2 = Num2Date(nEndDat...
So you want to copy the information of each row unter DETAILS into the related row unter RETURN OF ITEMS I guess: Put this calculate script into the object "ReturnOfItems" an remove the other calculations script fromt the text fields.var nCount = _Enter1.count, // Count instances
oThat = this; // C...
Hi, there's another way to reset a form, which works better than resetData().Given the root node of you form is named "form1" than it looks this way.xfa.datasets.data.loadXML("<form1/>", true, true);
xfa.form.remerge();
You need to tell the form to start a recalculation, since this is only triggered automatically through changed values but not the presence of objects. Add this code to the existing script that controls the presence of your subforms. xfa.form.recalculate(true);
Keep in mind: To test for an empty field you better use the isNull method or the operator === instead of ==. The latter can create false positives since it doesn't compare the types of objects. if (pmp.Page1.object1.kpi1.isNull) {
// do something
}orif(pmp.Page1.object1.kpi1.rawValue === null) ...
You can do this the same way a the average calculations.var oNodes = pmp.resolveNodes("#subform[*].#subform[*].Table1.Row1.#field.[Exists($.ui.#choiceList) eq 1]");
for (var i = 0; i < oNodes.length; i += 1) {
oNodes.item(i).mandatory = pmp.Page1.object1.kpi1.isNull ? "error" : "disabled";
}
To have all instances of that dropdown with the same value, just set the binding to global and make sure each is named the same way. For the presence you would have to use additional scriptings to check the presence of a referenced dropdown and copy to all other instances of it. Can you provide a s...