The CreatorCon Call for Content is officially open! Get started here.

on submit client script is not working

chandan2212
Tera Contributor

Hi All, 

 

onsubmit client script is not working 

function onSubmit() {
  var gr = g_form.getValue('action');
  
  if (gr === 'sharing') {
    alert('Chandan Patra');
    return false; // Prevents form submission
  }

  return true; // Allows form submission
}

 Thanks and Regards,

Chandan 

5 REPLIES 5

svirkar420
Tera Guru

Hi @chandan2212 , Try the below code I am sharing this should work fine,

function onSubmit() {
var gr = g_form.getValue('action');
if (gr === 'sharing') {
alert('Chandan Patra');
return false;
}
}

 

But if this is not working then there might be some conflicting conditions in your instance, which is bypassing the script that you are writing.

 

If this answer helps you in any ways please mark this as an accepted solution or helpful so it will benefit other readers as well.

Regards,

Saurabh V.