Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

If caller's email id (use custom field)

TanujB
Tera Contributor

. If caller's email id (use custom field) description is empty, then while submitting form will display an error message and it will not submit.  I am stuck in this please provide a answer for this

2 REPLIES 2

J Siva
Kilo Patron
Kilo Patron

Hi @TanujB 
You can achieve this via either onChange or onSubmit client script.
Share the script which you've written.
It'll help us to debug.
Regards,

Siva

GlideFather
Tera Patron

Hi @TanujB,

 

this is a draft of client script onSubmit:

(not tested, you need to validate)

function onSubmit() {
var yourField = g_form.getValue('field_name'); //rename field_name
    if (!yourField) {
        g_form.showFieldMsg('yourField', 'Field is required before submitting.', 'error');
        return false; // submission is aborted
    }
    return true; //submit ok
}


Replace field_name with your field name

_____
This reply is 100 % GlideFather and 0 % AI