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!
Does php understand the DOM? Is it possible to drill down to a specific object like can be done with Javascript, e.g. how would the following javascript code be written in php.
Ok, so php doesn't understand javascript. I was under the impression php could be used to get around the cross-browser issues of javascript and the issue of javascript being disabled by the client. If you can't access a form object and it's properties using php then how can php help with these issues?
I was under the impression that php could be used to get around the cross-browser issues of javascript ...
Yes, this is true. It (I should say, "The Developer") does this by sending a script to a browser based on what that browser is.
If you can't access a form object and it's properties using php then how can php help with these issues?
Is it the object you need, or the data returned when the submit button is pressed? That makes a big difference. Explain why you would need the object so that we can begin to understand and possibly help.
What I had in mind was two dropdown menu's. The the selection of the first menu would dynamically generate the selections for the second dropdown menu. The values of the selections from each menu would be submitted to a script that would generate the url of the appropriate page.
I could do this in javascript but would like to do this in php. The only reasons for doing this in php is to learn the language and to try to circumvent the problems of using a javascript. I guess I am trying to fit the problem to php rather than match php to the problem, just so I can learn php.
Well, you could do it with PHP, but with each selection, the form and it's info needs to make a trip back to the server. This is far less than ideal and the user won't like you much for it either.
That siad, Javascript makes a lot of sense along these lines. Below is the function that I use.