Page 1 of 1

Prevent or Disable ONBLUR event

Posted: Fri Oct 11, 2019 8:12 am
by Ake_Thai
I want to Prevent or Disable ONBLUR event from Textbox1 by using Javascript at ONFOCUS from Textbox2 in Rich Display file,
Do you have any function to disable ONBLUR Event ?

Thanks in Advance,
Apimook
Developer

Re: Prevent or Disable ONBLUR event

Posted: Thu Oct 24, 2019 11:11 am
by matt.denninghoff
It is not possible to prevent events from firing; the browser will always trigger them. And there is no simple way to detach an event handler from a widget like how you described.

If you have code that runs in the Profound UI "onblur" event that you would want to disable sometimes and not other times, I would recommend having that "onblur" code check a global boolean variable before running. You could set that variable in your "onfocus" event.

e.g. in onfocus:

Code: Select all

window.mydisableOnblur = true;
and in onblur:

Code: Select all

if (!window.mydisableOnblur){
  //do something
}
window.mydisableOnblur = false;

Re: Prevent or Disable ONBLUR event

Posted: Wed Oct 30, 2019 11:47 pm
by Ake_Thai
Thank you Mr.Matthew , Your Information are very useful, Thanks ^^