@carlosgalvarez this is the code I am using. I would like to (1) ensure the field is not required for users if they do not fill it out and (2) have multiple discount codes for multiple promotions. And if possible, explain how I would ensure certain promo codes are used once by a user (not essential, but would be great if you can explain).
$w.onReady(function () {
$w("#input3").onCustomValidation( (value, reject) => {
if (!value.includes("Promo Code 1")) {
reject("Value must include Promo Code 1.");
$w('#text227').show();
$w('#group8').hide();
total = 0
} else {
$w('#text227').hide();
$w('#group8').show();
total = 15
}
calc()
} );
});