Subtotal: $31,579.00
hi guys
i've created a form with live form and i have a field that i must check validity of input with a javascript code like this:
function isValidCode(input) {
if (!/^\d{10}$/.test(input)) return false;
const check = +input[9];
const sum = input.split('').slice(0, 9).map((x, i) => +x * (10 - i)).reduce((x, y) => x + y) % 11;
return sum < 2 ? check == sum : check + sum == 11;
}
i created another textbox that get false or true from function and i've tried serveral times for check my field but this code doesn't work in this module
what should I do?
thanks
Unfortunatly, It is not possible with Live Forms. You can only evaluate the JavaScript in Live Forms.