From 540163abebc860d7cb0e77a55aa07da8c2faeba2 Mon Sep 17 00:00:00 2001 From: Rashmi Tiwari <99129127+rashmi269@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:26:18 +0530 Subject: [PATCH] Update block_submit.js Added a validation to verify that 'someVariable' value is not null , so that the Block functionality works smoothly --- .../Catalog Client Script/Block Submit/block_submit.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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();