We have a dropdown and whenever we change it the form gets submitted. We are adding all the query parameters as hidden in the page. Also we dont want to add specific parameters. Below is the line which iterates through a list and adds them.
Now the problem is we have either string1 or string2 in the query parameters, but not both at the same time. Hence if we put string1 first in the condition the values of string2 are getting added multiple times and if we put string2 first then all the values of string1 are getting added as hidden. According to the definition if we the first condition fails it should check the second condition as well which is not happening. How can we make it work?