I have a subform named "QAN" that is hidden until the user clicks a radio button. If this subform is visible when the user clicks a custom e-mail button, I want to write a script that checks to see if the QAN subform is visible. I used the following with no success:
if (this.resolveNode("QAN").presence = "visible"){
do the following...
Can this script detect the presence of a subform that is dynamically changed from hidden to visible?
Solved! Go to Solution.
Views
Replies
Total Likes
If you want to check something you have to use == instead of =
If(QAN.presence == "visible")
{
do the follwing..
}else{}
== is an relational operator
= is an assignment of value (this.rawVaue = 3; means, the current object get the value 3)
Helpful?
Kind regards Mandy
Views
Replies
Total Likes
If you want to check something you have to use == instead of =
If(QAN.presence == "visible")
{
do the follwing..
}else{}
== is an relational operator
= is an assignment of value (this.rawVaue = 3; means, the current object get the value 3)
Helpful?
Kind regards Mandy
Views
Replies
Total Likes
The solution is so simple but not if you don't know the answer! Thank you so very much for your help!
-Don
Views
Replies
Total Likes
No problem. You're welcome!!
You understand it now?
Mandy
Views
Replies
Total Likes
I was able to get the scrit to work by using == in place of =.
Do you ever use single = sign? I have seen triple === also. What is this for?
Thanks
Views
Replies
Total Likes
As Mandy mentioned above above "=" is for assigning a value to something and "==" (or "!=", etc.) is for testing a value.
"===" (and "!==", etc.) is for testing an exact value. JavaScript is called a "loosely typed" language which means that you don't have to specify what type of variable you are using. In languages like Java (strongly typed) you have to specify what type of variable your variable is going to be (integer, string, boolean, etc.).
This can lead to problems sometimes in JavaScript if a number gets converted to a string and then you try to do math with it. By using "===" you can test that the variable is actually a number and not a letter or vice versa.
From some reading I've done it sounds like using "===" is a "best practice" for JavaScript. And it might be faster at performing comparisons, but not sure about that one.
Maybe someone who knows more about JavaScript can explain better.
Thanks Jono. I appreciate you explaining this.
-Don
Views
Replies
Total Likes
Views
Likes
Replies