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!
Hi,
I am trying to use three select boxes together, each of which update the next one.
All of the data for all of them is from a mySQL database.
What I am doing is resubmitting the form each one is changed, now, to stop the selected values from going, I am writing them to a variable and recieving them as they are posted. Then when filling the select box after the form has been submitted I make the varialbe the selected value. The only problem is that it is only storing the first word of the selected entry. e.g. for "Isle of Man" it gets "Isle", this seems bazarre.
Here is the code, I hope you guys can help..
First is right at the top of the code where the value is saved:
tommy1987 wrote:Hi,
I am trying to use three select boxes together, each of which update the next one.
All of the data for all of them is from a mySQL database.
What I am doing is resubmitting the form each one is changed, now, to stop the selected values from going, I am writing them to a variable and recieving them as they are posted. Then when filling the select box after the form has been submitted I make the varialbe the selected value. The only problem is that it is only storing the first word of the selected entry. e.g. for "Isle of Man" it gets "Isle", this seems bazarre.
Here is the code, I hope you guys can help..
I'm sorry, but I'm going to impose and make the following suggestion.
Now i have another problem which you can probably help with. I have three select boxes like I said, and they all update from each other. The first two are working as they should, however, the third one only updates from the second one and not the first one. The way I am knowing if it has changed is posting a hidden value called a as can be seen and then saying if($POST_['a']) and then my code.
It works fine for the first and second one however for the last one I tried writing if($_POST_['a'] or $_POST['b']) and then my update code.
I should probably mention that b is the hidden variable i post with the second select box.
tommy1987 wrote:Now i have another problem which you can probably help with. I have three select boxes like I said, and they all update from each other. The first two are working as they should, however, the third one only updates from the second one and not the first one. The way I am knowing if it has changed is posting a hidden value called a as can be seen and then saying if($POST_['a']) and then my code.
It works fine for the first and second one however for the last one I tried writing if($_POST_['a'] or $_POST['b']) and then my update code.
I should probably mention that b is the hidden variable i post with the second select box.
Its so annoying!!
Thanks anyway Tom
Hidden values should not matter as long as you have all three select boxes in the same <form> ... </form>.
I would only check for the select boxes values. I don't have the full script so I can't help you there. I would check to see that all three boxes are in the same form block. If one or the other isn't showing up then this could be the cause of your problem.