Hi Guys,
I need help.
first step: I have a dropdown list if i click in dropdownlist "a" and put in numeric field a number bigger than 99 the, checkbox should be marked and second step: a textfield1 should be visible.
the first step works perfectly but the second doesnt work.
this is my coding for the second step in event : change java script
if ((DropDownList1.rawValue == "a") && (this.rawValue == 1))
{
TextField1.presence = "visible";
}
else
TextField1.presence = "hidden";
does anybody have any idea why?
thanks!!
Diana
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Diana,
You are on the right track. deleteItem is zero based; so if you want to delete the second item it would be deleteItem(1).
I would recommend similar script in the dropdown exit, so that if the user goes back there and changes that value, the same logic will be applied. Also when you are deleting dropdown items using script, it is useful to addItem() again in the else part of the if statement. This way you can restore the list as the form is changed.
Also I would wrap the script in the numberField in another if statement to first check for null.
Example attached.
Good luck,
Niall
Views
Replies
Total Likes
Hi,
I would put the following in the exit of the dropdown and the checkbox:
if
(DropDownList1.rawValue == "a" && CheckBox1.rawValue == 1)
{
TextField1.presence
= "visible";
}
else
{
TextField1.presence
= "hidden";
}
(the script is all over the shop, but should be OK in the form).
Then in the exit event of the numeric field (after the changing of the checkbox value) you could call the checkbox exit event.
Good luck,
Niall
Withdrawn...i understand what is going on now
Views
Replies
Total Likes
Thank you so much it works perfectly!!!!
Views
Replies
Total Likes
Just another quick question.
I changed the textfield in dropdown list and try to delete one item in this dropdown list with:
DropDownList.deleteItem (2)
it deletes the third item but not the value 2, value 2 is"sie"
can u help me please!!
thank u!!
Diana
Views
Replies
Total Likes
Hi Diana,
You are on the right track. deleteItem is zero based; so if you want to delete the second item it would be deleteItem(1).
I would recommend similar script in the dropdown exit, so that if the user goes back there and changes that value, the same logic will be applied. Also when you are deleting dropdown items using script, it is useful to addItem() again in the else part of the if statement. This way you can restore the list as the form is changed.
Also I would wrap the script in the numberField in another if statement to first check for null.
Example attached.
Good luck,
Niall
Views
Replies
Total Likes
Hi Niall,
thanks a lot!!
it works perfect
Diana
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies