theniteowl
Programmer
Hi All,
I am pretty much a newbie at PHP but work in Javascript a lot.
Questions have come up in the Javascript forum a number of times recently regarding dynamically generated form fields where that names contain the [] characters like:
<input type="text" name="myField[]">
And they want to be able to address the fields via Javascript but it has trouble with the [] in the field names.
I believe somewhere in the past I read that on the PHP side there was a workaround so that these names could be rendered Javascript friendly without impairing the function on the PHP side. I have searched around and not been able to find any references to such a workaround but would like to find it so that people can be pointed in the right direction for future questions. The [] characters are considered reserved characters in Javascript and it causes all sorts of trouble.
Anyone have more detail on getting around this? I have to refresh the little PHP I knew as it is and so I cannot even pose the question well as a PHP question but would appreciate if someone knows the answer or has a link to a site explaining how to deal with this situation.
A lot of people get frustrated asking a question in the Javascript forum that get's an answer telling them they have to re-write their PHP code but no solid information on how.
Thanks.
It's hard to think outside the box when I'm trapped in a cubicle.
I am pretty much a newbie at PHP but work in Javascript a lot.
Questions have come up in the Javascript forum a number of times recently regarding dynamically generated form fields where that names contain the [] characters like:
<input type="text" name="myField[]">
And they want to be able to address the fields via Javascript but it has trouble with the [] in the field names.
I believe somewhere in the past I read that on the PHP side there was a workaround so that these names could be rendered Javascript friendly without impairing the function on the PHP side. I have searched around and not been able to find any references to such a workaround but would like to find it so that people can be pointed in the right direction for future questions. The [] characters are considered reserved characters in Javascript and it causes all sorts of trouble.
Anyone have more detail on getting around this? I have to refresh the little PHP I knew as it is and so I cannot even pose the question well as a PHP question but would appreciate if someone knows the answer or has a link to a site explaining how to deal with this situation.
A lot of people get frustrated asking a question in the Javascript forum that get's an answer telling them they have to re-write their PHP code but no solid information on how.
Thanks.
It's hard to think outside the box when I'm trapped in a cubicle.