一部のユーザーに関係のないフォームの特定のセクションを非表示にする Web ページの 1 つに次のコードがあります。ただし、何らかの理由で selectAttending 変数のみがバインドされています。テキスト ボックスと 2 つのドロップダウンの値を渡したいのですが、このドロップダウンの値しか渡されません。助言がありますか?
<html>
<input class="input-xlarge focused" id="txtName" type="text" >
<select name=selectAttending id=selectAttending>
<option>Select One...</option>
<option>Yes</option>
<option>No</option>
</select>
<select id=selectGender>
<option selected="selected">Select One...</option>
<option>Male</option>
<option>Female</option>
</select>
<script language=javascript>
$("#selectAttending").change(function () {
if ($('#selectAttending option:selected').text() == "No") {
$('#ifAttending').hide();
} else if ($('#selectAttending option:selected').text() == "Yes") {
$('#ifAttending').show();
} else {
$('#ifAttending').show();
}
});
</script>