onblur client script for configuration item in incident form

drp
Kilo Explorer

HI,

I need to put an custom onblur event on the configuration item (cmdb_ci) field on incident page. It looks like Servicenow already have onfocus event on this field and it is overwriting my custom event. I am using client script to fire an event.

Can any one help me ?

Thanks !!

4 REPLIES 4

bernyalvarado
Mega Sage

Hi drp,



Would you mind providing a little bit more of context of what you want to accomplish and how you're currently doing it to see if we can help you out?



Thanks,


Berny


bernyalvarado
Mega Sage

It will be great if you can share your script as well.



Thanks,


Berny


Hi Berny,



On incident form there is a field called 'Configuration Item' . I am writing a client script to fire onblur event on this field. Following is the script.


function onLoad()


{


 


      var fieldControl1 = g_form.getControl('incident.cmdb_ci');


      fieldControl1.onblur= cmdbci_OnMouseOut;


}


function cmdbci_OnMouseOut()


{


alert('1');


      var strSearch = g_form.getControl('incident.cmdb_ci').value;


    alert('strSearch' +strSearch);


}



But it never seems to fire this event. The same client script works fine if I use another field on incident form.


Why can't you just use a onchange client script for that field?