I have a simple goal though it requires a JavaScript for loop which I still pretty much totally suck at. All I want to do is have each option's value added to an input text field.
The first select option's value would be set as 'val_1' value.
The second select option's value would be set as 'val_2' value.
The third select option's value would be set as 'val_3' value.
The fourth select option's value would be set as 'val_4' value.
Simple replication, only I just can't figure out for loops in JavaScript (but I understand them in PHP).
It works almost perfectly only...
For value 1 val_' + i = 2
For value 2 val_' + i = 3
For value 3 val_' + i = 4
For value 4 val_' + i = 5
...etc, it should be...
For value 1 val_' + i = 1...but obviously not using that code/math?
To achieve this I change i's default value from 0 to 1...when I change it back nothing works.
Here is the works but not in the desired way working code...
Ah-ha! Awesome I learned something new, even though I'm not sure how to correctly reference it. I figured I needed to execute math and I did attempt to add +1 to the i variable though I was not aware I needed to use parenthesis to do so.
How do you correctly reference the terminology of using the child parenthesis here...?