0
私の問題は、ドロップダウンリストからアイテムをドロップダウンしてボタンをクリックするように変更しましたが、最初のアイテムをクリックすると、 2つ目は2つのレコードに2回アイテムをドロップします!!そして第三に、これは私のコード2つ以上のレコードをクリックボタンでコマンドを呼び出す際の問題
//to get the elements by document.ready function//
<script type="text/javascript">
$(document).ready(function(){
$("#DropDownList2").change(function()
{
// button to drop down the record to table//
$('#button1').click(function(){
GetData($("#DropDownList2 option:selected").text());
});
});
});
function GetData(itemName){
$.ajax({
url:'Default2.aspx?brand='+$("#DropDownList1 option:selected").text()+'&item='+itemName+'&itemId='+$("#DropDownList2 option:selected").val()+'',
type:'GET',
success: function(data)
{
if($("#tableContent tr:last").html() == undefined)
{
$("#tableContent").html(data);
}
else{
$("#tableContent tr:last").after(data);
}
}
});
}