Is there any option on timer field to write onChange client script?

swathigangadhar
Tera Expert

Is there any option on timer field to write onChange client script? If some one changes it manually i need to alert message. How to achieve it?

8 REPLIES 8

swathigangadhar
Tera Expert

I have a incident form in which am having a field called Timer (type is timer), Whenever person opens timer will start, and it is editable also, i want to alert message, when some one edit this timer field.



ie.,


onChange of Timer


{


alert('You editing timer');


}


Hi Swathi,



onChange on time field doesn't work as expected. I have found few questions on community regarding the same. You can go through these. May be this will help you.



onChange Script Not Working on Date/Time Field



Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

As far as I know onChange will not get triggered, you can make it read only using DOM .




Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


PriyaRanji
Tera Guru

Hi Swathi,

You can write the below line of code to wait for few seconds.

var setTimer='';

setTimer=setTimeout(setTimerDelay,2000);/*to set the timer for 2 sec*/

function setTimerDelay(){

alert('timer waits for 2 sec');

//your code 

}

 

Hope it will helps you!

Thanks,

Priyanka R