export function txtConfirmedPassword_input(event) { let password1 = $w("#txtPassword").value; let password2 = $w("#txtConfirmedPassword").value; if (password1 === password2) { console.log("They match!"); $w("#btnSubmit"); } else { $w("#text185").text ="Password and Confirmed Password do not match"; $w("#text185").show; $w("#btnSubmit").disable(); console.log("Password and Confirmed Password are not match"); } // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4 // Add your code for this event here: }
The text185 is not found in the preview page.
export function txtConfirmedPassword_input(event) { $w("#txtConfirmedPassword").onCustomValidation( (value, reject)=>{ let password1 = $w("#txtPassword").value; let password2 = value; if (password1 === password2) { console.log("They match!"); $w("#btnSubmit"); } else { //$w("#text185").text ="Password and Confirmed Password do not match"; //$w("#text185").show console.log("Password and Confirmed Password are not match"); reject("Password and Confirmed Password are not match"); } })
I don't know why changing the label would not have any effect. The validation would be processed only when the submit button is pressed.
I don't know the code is used to work, however, after I changed the position of the variable, the error message seems stick to the old position.