Mam w jednym formularzu po kilka takich samych pól o nazwie np po 3 razy: type1, type2, type3. Wybieram kategorię główną (za pomocą select i jQuery), następnie rozwijają się dopowiednie pola dla wybranej kategorii, które wcześniej były ukryte.
Jak zrobić, żeby ukryte dane z formularza za pomocą display: none; faktycznie nie były widoczne dla skryptu php przetwarzającego dane? Bo obecnie skrypt pobiera wartości z ostatnich pól (nieważne czy są wybrane czy są wciąż ukryte). A chciałbym, aby wartości w ukrytych polach faktycznie były ukryte, bo tak nadpisują dane z wybranych pól, które są wyżej wybierane.
<tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="category" name="category"> {foreach item=item from=$category} {/foreach} </select> </p> </td> </tr> <tbody id="WHISKY" class="displayNone"> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="country" name="country"> {foreach item=item from=$country} {/foreach} </select> </p> </td> </tr> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="type1" name="type1"> {foreach item=item from=$productCategoryWhisky} {/foreach} </select> </p> </td> </tr> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="type2" name="type2"> {foreach item=item from=$productCategoryWhisky} {/foreach} </select> </p> </td> </tr> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="type3" name="type3"> {foreach item=item from=$productCategoryWhisky} {/foreach} </select> </p> </td> </tr> </tbody> <tbody id="WINE" class="displayNone"> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="country" name="country"> {foreach item=item from=$country} {/foreach} </select> </p> </td> </tr> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="type1" name="type1"> {foreach item=item from=$productCategoryWineColor} {/foreach} </select> </p> </td> </tr> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="type2" name="type2"> {foreach item=item from=$productCategoryWineType} {/foreach} </select> </p> </td> </tr> <tr> <td class="formTableColumnLeft"> </td> <td class="formTableColumnRight"> <p> <select id="type3" name="type3"> {foreach item=item from=$productCategoryWineTaste} {/foreach} </select> </p> </td> </tr> </tbody>