I have a repeater which has rows of data, as well as an input field for each. I perform some bulk value update to my DB based on repeater entries which have a non-empty input field when a submission button is used.
The repeater is #repeater2, and #input1 is the field of the current repeater item which I check for non-empty as well as some regex match.
If these pass, I perform some operation.
This code has been live and functioning perfectly for 7+ months and has not been touched (neither has anything else on the page.)
All of a sudden, the operations weren’t committing and I am seeing “x[e.inputType] is not a function” in the javascript console, which I have narrowed down to the line
let input = $item("#input1").value;
I cannot seem to figure out what is suddenly causing the issue. Similar calls such as
let input = $item("#input1").valid;
have the same issue.
This only fails on the repeater items which I have entered some input for. If the input has been left blank (as is valid in my application) then these same calls succeed as they have been.
Here is the entire relevant code snippet:
(const promise is inside the if not sure why I cant get the indentation to show up correctly)
const regex = RegExp("[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)");
export function button3_click(event) {
// console.log("Button click")
$w("#button3").disable();
let promiseArray= [];
$w("#repeater2").forEachItem(($item, itemData, index) => {
console.log(itemData)
let input = $item("#input1").value;
if (input !== "" && regex.test(input) === true) {
const promise = payBalance(itemData.payPeriod, itemData.agent_id, $item("#input1").value);
promiseArray.push(promise);
}
});
Promise.all(promiseArray).then(function(promises) {
wixLocation.to(wixLocation.url);
});
}
I have been struggling to find any more information about this online and on these forums, and Javascript is by no means my programming area of expertise so any help is greatly appreciated!