キープレスイベントを、動的に構築される要素のフォームにバインドする必要があります。以下を参照してください
<div class="Customer">
<select name="dropdown1" id="dropdown1">
</select>
<input type="textbox" name="firstname1" id="firstname1">
<input type="textbox" name="lastname1" id="lastname1">
</div>
<div class="Customer">
<select name="dropdown2" id="dropdown2">
</select>
<input type="textbox" name="firstname2" id="firstname2">
<input type="textbox" name="lastname2" id="lastname2">
</div>
... and repeat..
上記の要素のいずれかが変更されるたびに、他の要素が空でないことを確認する必要があります。
フォームには他にもいくつかの要素がありますが、コード セグメントで強調表示されている要素だけを気にします。
どうもありがとう、
次のコードを試しました
$('.Customer').each(function (index) {
alert("test"); // alerts the correct number of customer rows
$("input:textbox").click(function() {
alert("");
})
});
ソリューションはjQuery 1.3.2で動作するはずです