diff --git a/Client-Side Components/Catalog Client Script/Block Submit/block_submit.js b/Client-Side Components/Catalog Client Script/Block Submit/block_submit.js index d63e2762d6..6b213b1e0c 100644 --- a/Client-Side Components/Catalog Client Script/Block Submit/block_submit.js +++ b/Client-Side Components/Catalog Client Script/Block Submit/block_submit.js @@ -1,7 +1,13 @@ //Block the user from submitting the form based on variable answer function onSubmit() { - var someVariable = g_form.getValue("someVariable"); - if(someVariable == 'No'){ + var VariableName = 'someVariable'; + var VariableVal = g_form.getValue(VariableName); + // Basic validation + if (!VariableVal) { + g_form.showFieldMsg(VariableName, 'Please answer this question before submitting.', 'error'); + return false; + } + if(VariableVal == 'No'){ var gm = new GlideModal('glide_warn',false); gm.setTitle("Submit Blocked! You can only use this form for someReason. Review someInstructions"); gm.render();