Random choice in tease
Posted: Mon Oct 18, 2021 2:32 am
Hi,
I am working on a tease and while it's working when I run a preview, i'm getting a validation error (i'm assuming that will stop me from publishing the tease).
I am using this:
var holdEdge = Math.floor(Math.random() * 100) ;
if (holdEdge < 70) {
holdEdgeResult = "Hands off";
} else if (holdEdge < 90) {
holdEdgeResult = "Stay on the edge";
var holdIt = true;
} else {
holdEdgeResult = "Let it fade";
}
Basically, i'm trying to get this to randomly get you to hold the edge or not...I wrote it for 3 possibilities, but obviously i'm currently only using two of the three.
I am getting this in the validator:
NULL value found, but a string is required
Does not have a value in the enumeration ["left","right","center"]
I'm not exactly sure how to fix it?
I am working on a tease and while it's working when I run a preview, i'm getting a validation error (i'm assuming that will stop me from publishing the tease).
I am using this:
var holdEdge = Math.floor(Math.random() * 100) ;
if (holdEdge < 70) {
holdEdgeResult = "Hands off";
} else if (holdEdge < 90) {
holdEdgeResult = "Stay on the edge";
var holdIt = true;
} else {
holdEdgeResult = "Let it fade";
}
Basically, i'm trying to get this to randomly get you to hold the edge or not...I wrote it for 3 possibilities, but obviously i'm currently only using two of the three.
I am getting this in the validator:
NULL value found, but a string is required
Does not have a value in the enumeration ["left","right","center"]
I'm not exactly sure how to fix it?