We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75524d3 commit 540163aCopy full SHA for 540163a
Client-Side Components/Catalog Client Script/Block Submit/block_submit.js
@@ -1,7 +1,13 @@
1
//Block the user from submitting the form based on variable answer
2
function onSubmit() {
3
- var someVariable = g_form.getValue("someVariable");
4
- if(someVariable == 'No'){
+ var VariableName = 'someVariable';
+ var VariableVal = g_form.getValue(VariableName);
5
+ // Basic validation
6
+ if (!VariableVal) {
7
+ g_form.showFieldMsg(VariableName, 'Please answer this question before submitting.', 'error');
8
+ return false;
9
+ }
10
+ if(VariableVal == 'No'){
11
var gm = new GlideModal('glide_warn',false);
12
gm.setTitle("Submit Blocked! You can only use this form for someReason. Review someInstructions");
13
gm.render();
0 commit comments