I never used javascript, but I need it for my project.
I would like to use a php array which is called abc[] inside a javascript function.
Currently the working javascript code is:
if(document.form1.checkbox[i].checked)
I would like to use the abc[] array instead of checkbox
This doesn’t work, because the [] of the php array name mix with the [i] of the javascript code…but it shows what I would like to achieve:
if(document.form1.abc[][i].checked)
Is it possible to define abc[] as xxx variable in javascript or use any other method to get this working?
if(document.form1.xxx[i].checked)
where xxx=abc[]
You can always access object properties as array like this: