0
私は、いくつのROWに基づいて選択タグを挿入するループを持っています。私のselectタグはidがselID0、selID1、selID2になります...私は、送信ボタンをクリックしたときに選択されていないタグをチェックするajax関数を呼び出したいと思います。ForループでAjaxにデータ文字列を設定する
forループを使用してAjax関数でデータ文字列を作成しようとしました。私はどのように文字列を構築するかわからないまたは文字列を挿入する別のですか?助けてください、ありがとう。
do while i < Cint(sROW)
response.write "<tr>"
response.write "<td>"
response.write " <select class='form-control' id='selID" & i & "' name='selID" & i & "'>"
response.write " <option value=''>Select</option>"
response.write " <option value='a'>a</option>"
response.write " <option value='b'>b</option>"
response.write " <option value='c'>c</option>"
response.write " <option value='d'>d</option>"
response.write " </select>"
response.write "</td>"
response.write "</tr>"
i=i+1
loop
のAjax機能
function checkselect() {
var url_to = 'ax_postcheckselect.asp';
For (i = 0, i< <%=sROW %>, i++)
{
var str = """selID""" + i + ":$(""#selID" + i + """).val(),"
var kae = kae + str
};
$.ajax({
url : url_to,
type : 'POST',
data : { "txtRow":$("#txtRow").val(),
kae
},
基本的に私は助けてください
data : { "txtRow":$("#txtRow").val(),
"selID0":$("#selID0").val(),
"selID1":$("#selID1").val(),
"selID2":$("#selID2").val(),
"selID3":$("#selID3").val(),
and so on depending on how many sROWs.
},
するデータ部分を移入したいです。
なぜ$( 'form')。serialze()を使用してフォームデータをすべて送信するのですか? –
こんにちはジョシュ、あなたの返信のおかげで、$( 'フォーム')を使用する方法を大まかに示すことができますか? –