You can define your own custom functions to validate user input on button click. To achieve this add data-callback="{someFunction}" to the launch button. Then define your custom function in a JS file that accepts two parameters: onSuccess, onFailure.
Example
We have as an example the following HTML elements:
In the following example function we perform simple front-end validation to match the data-callback="validatePassword"attribute defined in the yomLaunch-1 button:
function validatePassword(onSuccess, onFailure) {
const passwordInput = document.getElementById('password');
const enteredPassword = passwordInput.value;
const hardcodedPassword = 'secure123'; // This is the hardcoded password
if (enteredPassword === hardcodedPassword) {
onSuccess(); // Call the success callback if the password is correct
} else {
onFailure(); // Call the failure callback if the password is incorrect
}
}