multirow variable set is accepting single group. User should not be able to submit single row
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2024 11:53 PM
multirow variable set is accepting single group. User should not be able to submit single row how to achieve this
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2024 02:42 AM - edited ‎09-02-2024 02:44 AM
You can get the value of the entire MRVS, parse it, and stop the submit if the length of the object is less than 2 (rows)
function onSubmit() {
var mrvs = g_form.getValue('mrvs_internal_name');
if(mrvs.length > 2) { //length of the entire MRVS string - native UI returns [] for empty MRVS value which causes a parsing error
var obj = JSON.parse(mrvs);
If (obj.length < 2) { //MRVS contains only one row
alert('Group table must contain more than one row.');
return false;
}
} else { //MRVS does not contain any rows
alert('Group table must contain at least two rows.');
return false;
}
}