Buy Now
Sign in


lapo78 , February 17 2018
lapo78 45
February 17 2018 #375495
i've this custm check
function customCheck(el){
var field= jQuery('input[name=field_name]:checked').val();
if (field === 'no') {
if ( !el.value.test(/[^.*]/) ) {
alert('required '+el.value);
return false;
} else {
return true;
It works if field is "no", alert works if el.value match with regexp, but error.push doesn't work.
GreyHead 63.4
February 17 2018 #375499
Hi lapo78,
Please try single quotes in
If that does not help then you can use console.log(el.errors) to see exactly what is - or is not- being added to the errors list.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
lapo78 45
February 17 2018 #375503
lapo78 45
February 17 2018 #375504
with console.log(el.errors):
["required"]0: "required"length: 1__proto__: Array(0)$constructor: ƒ Array()$family: ƒ ()append: ƒ (b)associate: ƒ (b)average: ƒ ()clean: ƒ ()clone: ƒ ()combine: ƒ (b)contains: ƒ (b,a)each: ƒ (b,a)empty: ƒ ()erase: ƒ (b)flatten: ƒ ()getLast: ƒ ()getRandom: ƒ ()hexToRgb: ƒ (b)hsbToRgb: ƒ ()include: ƒ (b)invoke: ƒ (b)link: ƒ (b)max: ƒ ()min: ƒ ()pick: ƒ ()rgbToHex: ƒ (b)rgbToHsb: ƒ ()shuffle: ƒ ()sum: ƒ ()unique: ƒ ()concat: ƒ concat()constructor: ƒ Array()copyWithin: ƒ copyWithin()entries: ƒ entries()every: ƒ every()fill: ƒ fill()filter: ƒ filter()find: ƒ find()findIndex: ƒ findIndex()forEach: ƒ forEach()includes: ƒ includes()indexOf: ƒ indexOf()join: ƒ join()keys: ƒ keys()lastIndexOf: ƒ lastIndexOf()length: 0map: ƒ map()pop: ƒ pop()push: ƒ push()reduce: ƒ reduce()reduceRight: ƒ reduceRight()reverse: ƒ reverse()shift: ƒ shift()slice: ƒ slice()some: ƒ some()sort: ƒ sort()splice: ƒ splice()toLocaleString: ƒ toLocaleString()toString: ƒ toString()unshift: ƒ unshift()Symbol(Symbol.iterator): ƒ values()Symbol(Symbol.unscopables): {copyWithin: true, entries: true, fill: true, find: true, findIndex: true, …}__proto__: Object