@daniel1836 Can you provide your code?
I'm guessing there is no element in the DOM with the same ID in your other files
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I know jQuery isn't the most popular.
But I have an issue, where jQuery receives form data through an ID, and passes it through AJAX to my PHP.
My code works as it's supposed to. But when I access the same function (through different files) (because I have to repeat the same functionality in my project from a different location), it cannot find the same ID.
I am confused because nothing is changed. My only guess is the DOM is different. But the flow of the code through JavaScript and PHP functions is exactly the same.
Can anyone fill me in on jQuery as it pertains to my situation? I am still new with it.
Thanks
What do you get if you var_dump($_POST);
I would suggest using PDO.
Please or to participate in this conversation.