I have three sets of form fields that are shown and hidden by jQuery and a Select list.
They are displaying just like I want them. But now the information that was being passed to the php code from the first two sets is being lost and if the bottom set of three fields are the set used. The information is passed no problem.
Is this a case of similarly named items lower in the page erasing the information of items in the upper part of the pages?
How do I get around this?
<ul id="options">
<li>
<h2>Your guest names</h2>
<label for="GuestName">Guest:</label> <input type="text" style="width:180px;" name="GuestName" id="GuestName" /><br/>
</li>
<li>
<h2>Your guest names</h2>
<label for="GuestName">Guest:</label> <input type="text" style="width:180px;" name="GuestName" id="GuestName" /><br/>
<label for="GuestName2">Guest 2:</label> <input type="text" style="width:180px;" name="GuestName2" id="GuestName2" /><br/>
</li>
<li>
<h2>Your guest names</h2>
<label for="GuestName">Guest:</label> <input type="text" style="width:180px;" name="GuestName" id="GuestName" /><br/>
<label for="GuestName2">Guest 2:</label> <input type="text" style="width:180px;" name="GuestName2" id="GuestName2" /><br/>
<label for="GuestName3">Guest 3:</label> <input type="text" style="width:180px;" name="GuestName3" id="GuestName3" /><br/>
</li>
</ul>
<script>
$("li").hide();
$("#numberattending").change(function() {
var index = $(this).children(":selected").index();
$("#options").children().hide().eq(index).show();
});
</script>