arcadeicons
Member
I have two circumstances that I need to validate submissions that require checking multiple conditions. I'm using the validation 'greater or less than' plugin but I'm confused, is the validation to fail or succeed. e.g. IF A == B then ok to submit? or fail?
Situation 1) I need to replace a player's current score for a game in a tournament at a specific location, only if their new score is higher than the currently logged/or no existing, score for that player. So I need to validate something like this...
IF {tournID} = submit_score___tournID or NULL
AND {eventID} = submit_score___eventID or NULL
AND {locID} = submit_score___locID or NULL
AND {gameID} = submit_score___gameID or NULL
AND {userID} = submit_score___userID or NULL
AND newscore > submit_score___gamescore or NULL
THEN submit and overwrite submit_score___gamescore with newscore
else message "You already have a higher score for {Game Name} at {Tournament Name}, {Location Name}
Situation 2) Some tournaments are 'Public with invite only' meaning a tournament manager will hand out an invite code for people to use when they register. Other tournaments are 'Public - Open' with no code needed.
People use the same form to register for all tournaments so I need to validate on
IF add_tournament___invite_code is NULL
OR invite_code = add_tournament___invite_code
THEN submit
else message 'Incorrect invitation code'
Situation 1) I need to replace a player's current score for a game in a tournament at a specific location, only if their new score is higher than the currently logged/or no existing, score for that player. So I need to validate something like this...
IF {tournID} = submit_score___tournID or NULL
AND {eventID} = submit_score___eventID or NULL
AND {locID} = submit_score___locID or NULL
AND {gameID} = submit_score___gameID or NULL
AND {userID} = submit_score___userID or NULL
AND newscore > submit_score___gamescore or NULL
THEN submit and overwrite submit_score___gamescore with newscore
else message "You already have a higher score for {Game Name} at {Tournament Name}, {Location Name}
Situation 2) Some tournaments are 'Public with invite only' meaning a tournament manager will hand out an invite code for people to use when they register. Other tournaments are 'Public - Open' with no code needed.
People use the same form to register for all tournaments so I need to validate on
IF add_tournament___invite_code is NULL
OR invite_code = add_tournament___invite_code
THEN submit
else message 'Incorrect invitation code'