As part of a PHP page, I have a form. In the form a DropDownBox has been used. I need to retrieve the value selected by the user, preferably in a session variable, BEFORE the form is submitted. I need this because, based on the value chosen by the user, I’ll need to give them additional textboxes and radio buttons to input more data which, along with other details, then has to be stored in the database. The problem is, in order to use POST/GET/REQUEST, I’ll need to send the data to another link. I do NOT want that.
I also tried using javascript, onChange event. How do I convert the javascript variable into a PHP variable? Is there another way to go about this?
The way I’ve gone between Javascript and Server Scripts is using a hidden input field. This way you can send that value you when you submit the form and you can manipulate the value client-side as well. But using AJAX is a good way to go as well.