- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 05:30 AM - edited ‎12-12-2022 05:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 05:42 AM
Try with below script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// now check the length
if (newValue.toString().length != 16) {
alert("Password should have exact 16 letters");
g_form.clearValue('backend_name_of_your_password_variable'); // Make sure to use backend name of your variable.
}
}
You can also utilize Variable Validation Regex to create regex as per your need and use that regex for validation of your variables, however it is not available for all types of variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 08:31 AM - edited ‎12-08-2022 08:33 AM
Use below script.
function onSubmit() {
//Type appropriate comment here, and begin script below
var pass = g_form.getValue('backend_name_of_your_password_variable');
if (pass != '') {
if (pass.length < 16) {
alert("Password should have minimum 16 letters");
g_form.showFieldMsg('backend_name_of_your_password_variable', 'Password should have minimum 16 letters', 'error', true);
return false;
}
}
}
Use alert or field message as per your need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 05:52 AM
Hi, try this: (replace fieldValue with newValue)
if(newValue.length != 16){
alert("Password should have exact 16 letters");
g_form.clearValue('Password');
}
Mark my response as correct/helpful if this solves your issue