How to call UI script in client script

sunnysunny
Kilo Contributor

I created a simple ui script, as mentioned below. How can I call this from client script?

function displaytitle()

{

  var a= g_form.getValue('number');

  var b= g_form.getValue('short_description');

  if(a && b)

{

  top.document.title= a +'-'+ b;

}

  else

  {

  alert('hello');

  }

}

15 REPLIES 15

sunnysunny
Kilo Contributor

This is the screen shot.


abc.bmp



abc.bmp



still not working


Hi Sunny,



Seeing your scripts and all you must call like below. Please define the function in the UI Script on first line as function settile(g_form)



var validateFields = new display_title_on_incident_page(); // You need to pass the title of the UI Script here


validateFields.settile(g_form);



I hope this helps.Please mark correct/helpful based on impact



Ok so the first line in UI script would be "function settile(g_form)"?



and where does these 2 lines go


var validateFields = new display_title_on_incident_page(); // You need to pass the title of the UI Script here


validateFields.settile(g_form);


Hi Sunny,



Those 2 lines should be written in the client script.



I hope this helps.Please mark correct/helpful based on impact



sunnysunny
Kilo Contributor

still not working