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

g_form.showErrorBox and showFieldMsg do not work at Service Portal

qqj5004
Kilo Contributor

Hi all

the onLoad Client Script with g_form.showErrorBox or g_form.showFieldMsg   do not work in Service Portal.

function onLoad() {

  var msg = 'check at lease one checkbox';

if(g_form.getValue("add_user", false)){

g_form.showErrorBox('right', msg);

}

}

This script work on CMS but not on Service Portal

Please Help!!!

Thank you

15 REPLIES 15

Jace Benson
Mega Sage

Maybe failing as getValue doesn't take two parameters.



The methods on the portal seem to be more strict.   Another thing would be to check for errors in your console, and disable other client scripts.



Try this;


function onLoad() {


  var msg = 'check at lease one checkbox';


  if(g_form.getValue("add_user")){


      g_form.showErrorBox('right', msg);


  }


}


"add_user" is a checkbox variable



function onLoad() {




  var msg = 'check at lease one checkbox';


var x = g_form.getValue("add_user");


if(x == 'false'){


g_form.showErrorBox('right', msg);


}


}



does not work either


Is your catalog client script's UI Type is set to All ?




Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Yes