On submit validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Community,
I have one requirement, In form level having requestor for filed and assignment group filed, requestor field taking the user table and in assignment group filed taking the group table, and in my requirement they ask me to create one new check box filed which is assign to me and if user check the check box which is assign to me and user is the member of that group then the form should submits and if user is not member of that group then form should not be submitted.
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
30m ago
I'm not sure I understand what you are asking here. Please take a look at this article on how to write a quality question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16m ago - last edited 11m ago
While its not clear exactly where you are trying to do this if we assume its a catalog item or record producer then you could simply add a catalog client script as follows. A similar onSubmit script could be used any where but the syntax/method for accessing the variables might change slightly...
function onSubmit() {
var assignmentGroup = g_form.getValue('variable_name'); //replace variable_name with the correct name of the assignment group variable
if (g_form.getValue('check_box_variable') == true) { //replace check_box_variable with the correct name of the assign to user check box variable
if (gs.getUser().isMemberOf(assignmentGroup) {
return true;
} else {
alert("You are not a member of the assigment group."); //this message will be shown to the user when the validation fails, word it appropriately.
return false;
}
} else {
return true;
}
}