Does not contain query in onsubmit script

chitra1
Tera Contributor

Hi All,

 

Basically, my requirement is a prefix check on the form , if the name does not contain the "GDC" prefix, the form should not be saved, preventing the user from changing the prefix.

 

Based on the organization, name prefix will automatically populate, attached screenshot for reference.

 

Tried this code: 

name1.addQuery('name','DOES NOT CONTAIN','IN-GDC');
 
Any suggestions please.
 
Thanks,
Chitra
6 REPLIES 6

chitra1
Tera Contributor

Hi @Sohithanjan G @yad_achyut ,

 

Thank you so much for your Help 🙂

 

They just want to display the highlighted text because the error message may get longer in the future if there are more than 10 or 20 dropdowns.

 

chitra1_0-1710329802683.png

 

 

Thanks,

CD

Parth_Poriya
Tera Expert

Hi

 

You can try with client script i.e = OnSubmit()

 

var name = g_form.getValue('name')

 

if(name.search(/IN-GDC/) !=0)

{

         return false

}

else

{

       return true

}