PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am having a problem with using javascript and php in the same project. I have simplified my code to make my problem easier to understand. Basically my probelm is: I have a form in HTML with a series of check boxes, that are manipulated in javascript. I do this by creating javascript funtions for the checkboxes, and calling them using "onClick=(apress(document.form1.boxes)" in my check box tag. This works fine, until I want to send these off to my PHP script in the $_POST array. I figured out how to get the values in the PHP by adding "[]" after name of each checkbox, but once I do this I am unable to use the javascript functions even when I change it to "onClick=(apress(document.form1.boxes[])"
Like I said, I just simplified the code to show my problem. In realiity i have at least 40 checkboxes that all influence eachother based on how they are checked. And all of their statuses need to be mailed, so that seems like a last resort. I'm sure there is a way to do this. Thanks for posting tho.
ok i got it working for anyone whose interested the problem was as i suspected the brackets [] were interfereing with the javascript the trick is to escape the brackets using