Can anybody suggest why the following function isn't working? addItem doesn't seem to accept "i" as an argument.
function
dropdownRange(dropdown,start,end,increment)
{
for (var i = start; i < end; i+=increment) {
dropdown.addItem(i);
}
}
I'm am calling the function from a radio group change event that toggles the drop-down range:
functions.dropdownRange(mydropdown
,200,1500,100);
Thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
Everything looks fine except the addItem syntax.
It must be written as:
dropdown.addItem(i+''); // don't forget to convert the integer variable i to string here..
Thats all to go..
Nith
Views
Replies
Total Likes
A bit more information:
The code is returning the error:
"Argument mismatch in property or function argument"
I don't believe there is an argument mismatch though. If I add square brackets as if passing an array: dropdown.addItem([i]), the script runs successfully but with an 'empty' value for each item.
Views
Replies
Total Likes
Everything looks fine except the addItem syntax.
It must be written as:
dropdown.addItem(i+''); // don't forget to convert the integer variable i to string here..
Thats all to go..
Nith
Views
Replies
Total Likes
That's it! Thanks very much Nith.
It works but I don't understand why. Can you explain?
Views
Replies
Total Likes
The addItem() methods accepts one or two string arguments.
The syntax is:
addItem(string param1[,string param2])
You were attempting to supply an INTEGER value as the parameter which caused that issue.
Nith
Views
Replies
Total Likes