need to stop the form submission on workspace

saikumarkak
Tera Contributor

how can i stop the form submission on workspace when assigned to is empty. 

28 REPLIES 28

saikumarkak
Tera Contributor

@Ankur Bawiskar,

yes, I checked that have three events one is show error message and another one redirect to the list screen that was correct but why the form is getting saved without filling the mandatory fields

 

@saikumarkak 

can you share the code for that Save button?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

saikumarkak
Tera Contributor

@Ankur Bawiskar ,
Do you know how to write the client scripts in workspace to stop the form submission..
if you provide that i will link that client script to the save button.

@saikumarkak 

simply use onSubmit client script on your table and see value is empty or not

if empty then stop form submission

function onSubmit() {
    if (g_form.getValue('assigned_to') == '') {
        alert('Please fill assigned to');
        return false;
    }
    return true;
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader