- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2019 09:06 AM
Hi Easwar,
I was looking to make a sure at least one entry exist in the multi row variable set. I don't know if you found a way to it.
I came with the solution of a on submit client script (I think what the doc refers to is for on submit that would run after each entry being added). Here is a code snippet that I was able to use to make sure there is at least one row:
function onSubmit() {
if(g_form.getValue('internal_name_of_variable_set') == '[]'){
g_form.addErrorMessage('You must enter at least 1');
return false;
}
}
g_form.getValue returns a JSON of the variable set, so simply by checking if it is an empty array, I was able to block submission in that case.
I think you could solve your second requirement with this (parsing the JSON and doing a length validation: array.length < 11). However this is not the best User experience as you are checking this on submit while the user already entered more than 10 entries.