how to check mandatory field using script?

Akki1
Tera Contributor

How can i check if the field is mandatory in client script?

8 REPLIES 8

not working.

I am selecting mandatory field but still it is showing false.

g_form.isMandatory("caller_id");

kindly help

Hello @akashmahind 

 

Write it under onchange client script.

Samaksh Wani
Giga Sage
Giga Sage

Hello @Akki1 

 

if you are looking for portal :-

 

document.getElementById(form).querySelectorAll("[required]")

 

Nuno Oliveira
Mega Guru

I have exactly the same question but in the backend. 

 

I was building a script to verify that. Where it looks up firstly for the variables that are mandatory (it means going to the variables table and variable set table and lookup for the item, and then retrieve all the variables). Then, do a lookup for the mandatory field equals to true or lookup for the catalog client script or catalog UI policy table and lookup in the script field for a mandatory instruction and finally lookup into the ui policy actions. 

 

Is there a way of doing this easily? I'm in the backend. It is related with an integration.