03-15-2019, 02:13 AM
Howdy All!
I have a region that is visible for the user to add some notes. If the user clicks outside the region, I want to close it. I have found the following code example:
https://jsfiddle.net/kym2rvyL/1/
I have tried adding a modified version of the function below to my form's Javascript property but it doesn't get called.
window.addEventListener('click', function(e){
if (document.getElementById('clickbox').contains(e.target)){
alert("Clicked in Box");
} else{
alert("Clicked outside Box");
}
})
Any idea what I am doing WRONG?
Thanks,
Shane
I have a region that is visible for the user to add some notes. If the user clicks outside the region, I want to close it. I have found the following code example:
https://jsfiddle.net/kym2rvyL/1/
I have tried adding a modified version of the function below to my form's Javascript property but it doesn't get called.
window.addEventListener('click', function(e){
if (document.getElementById('clickbox').contains(e.target)){
alert("Clicked in Box");
} else{
alert("Clicked outside Box");
}
})
Any idea what I am doing WRONG?
Thanks,
Shane