I am having issues with my script:
Checkbox is named - CO14
TextField is named - HQName
TextField is named - HQNumber
I would like the persons name Jane Doe to appear in the textfield HQName
" " number 222-231-4567 to apear the textfield HQNumber
I would also like for there name to disappear once the check box is deselected
This is what I have as my script now and of course it is not working the only thing that happens is Jane Doe name appears.
if
(CO14.rawValue == 1)
}
HQName.rawValue = "Jane Doe"; HQNumber.rawValue = 222-231-4567 + "\n";
}
Any help is appreciated.
Solved! Go to Solution.
Views
Replies
Total Likes
Because this is a checkbox and it only has two values, there is no need to check for teh 2nd value. If it is not 1 it must be 0. You can just add an else section that will blank out those fields:
if
(CO14.rawValue == 1)
HQName.rawValue = "Jane Doe"; HQNumber.rawValue = 222-231-4567 + "\n";
} else {
HQName.rawValue = "";HQNumber.rawValue = "";
}
Hope that helps
Paul
{
Views
Replies
Total Likes
You need to open your curly brace instead of closing it to begin with:
if
(CO14.rawValue == 1)
{
HQName.rawValue = "Jane Doe"; HQNumber.rawValue = "222-231-4567" + "\n";
}
Paul
Views
Replies
Total Likes
Hi,
This should work:
if (CO14.rawValue == 1) {
HQName.rawValue = "Jane Doe";
HQNumber.rawValue = "222-231-4567" + "\n";
}
The telephone number also needs to be in quotation marks. The first curly brackets was the wrong one/way, but that could have been a typo in the post.
Hope that helps,
Niall
Views
Replies
Total Likes
If I deselect the checkbox what script is used to make the name and number disappear?
Views
Replies
Total Likes
Because this is a checkbox and it only has two values, there is no need to check for teh 2nd value. If it is not 1 it must be 0. You can just add an else section that will blank out those fields:
if
(CO14.rawValue == 1)
HQName.rawValue = "Jane Doe"; HQNumber.rawValue = 222-231-4567 + "\n";
} else {
HQName.rawValue = "";HQNumber.rawValue = "";
}
Hope that helps
Paul
{
Views
Replies
Total Likes
Perfect!
Thanks Paul and Niall
Views
Replies
Total Likes