Hello,
I am trying to complete a script where the fill color of a numeric field changes when the user selects a particular option from a drop down list. My code in initialize works for the default selection in the list, but I can't seem to get the form to change the fill color when the drop down list is changed. This is my code under change event for the drop down object:
if
(topmostSubform.Page1.DropDownList1.rawValue == "OPTION A")
{
topmostSubform.Page1.NumericField1.fillColor
= "50, 205, 50";
}
if
(this.rawValue == "OPTION B")
{
topmostSubform.Page1.NumericField1.fillColor
= "255, 0, 0";
}
if
(topmostSubform.Page1.DropDownList1.rawValue == "OPTION C")
{
topmostSubform.Page1.NumericField1.fillColor
= "255, 255, 0";
}
Appreciate any help!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Try this in the exit event of the dropdown:
if (this.rawValue == "OPTION A")
{
NumericField1.ui.oneOfChild.border.fill.color.value = "50,205,50";
}
else if (this.rawValue == "OPTION B")
{
NumericField1.ui.oneOfChild.border.fill.color.value = "255,0,0";
}
else
{
NumericField1.ui.oneOfChild.border.fill.color.value = "255,255,0";
}
The form will need to be saved as a Dynamic XML Form and you will need to give the NumericField an initial while background colour.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
Try this in the exit event of the dropdown:
if (this.rawValue == "OPTION A")
{
NumericField1.ui.oneOfChild.border.fill.color.value = "50,205,50";
}
else if (this.rawValue == "OPTION B")
{
NumericField1.ui.oneOfChild.border.fill.color.value = "255,0,0";
}
else
{
NumericField1.ui.oneOfChild.border.fill.color.value = "255,255,0";
}
The form will need to be saved as a Dynamic XML Form and you will need to give the NumericField an initial while background colour.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
I have updated two of our examples, which now use the oneOfChild scripting property. Previously I had been creating SOM Expressions for the objects and resolving the node, until put straight on the issue by John Brinkman.
Here are the links to the updated examples:
Page 2 of this example: http://assure.ly/ewrLMo
Using a function in a script object: http://assure.ly/h8ZLr5.
Niall
Views
Likes
Replies
Views
Likes
Replies