I use an HTML form where I ask the user to select some data in a scroll menu. With jQuery and PhP I handle this data, then I display another scroll menu, depending of the item chosen in the first one. The second scroll menu is entirely echoed by a php function.
My second scroll menu is located in a DIV, named "camp". My jQuery code ends like this :
The problem is that each time I select something in the first scroll menu, another second menu displays again. The program appends the result, which is normal. But the results "match", that is to say that the results of the extra menu are consistent with the last selection in the first menu.
So I tried to replace the old data by the new, and I changed my code :
Now it's ok, every time I change something in the first menu, there no appearance of an extra second menu. But now my problem is that the data in the second scroll menu still refer to my first selection.
For instance, if I select the item "1", a second menu displays "1". If now I change my first item to "2", my second scroll menu still displays "1". In other words, it is not refreshed.
Here is a piece of my HTML :
<?php include 'functions.php'; propose_choix_BDD(); ?> <BR> <div class="camp"></div> <BR><BR><BR>
propose_choix_BDD() displays a scroll menu. To put it in a nutshell, I'd like to fill the "camp" div with the result selected in the first scroll menu. If I write this : ...
The first time I select something, it displays properly. But the next times, the value displays doesn't change anymore. Though, "data" changes, as I test it in my success: jQuery script.
How could I slove this ?