フォーム名を関数に渡し、それらが読み取られたことを確認して削除した後、アクションを変更してフォームを送信します。
function deletePhone(myForm){
var r=confirm('Are you sure you want to delete this phone?');
if(r==true){
$(myForm).attr("action","index.cfm?deleteThis=1");
$(myForm).submit();
}
}
currentrowは、複数のフォームを作成していて、フォームのcurrentCountを保持しているため、使用している変数です。
<a href="javascript:deletePhone('EditPhone_form_#currentrow#');">X Delete Phone</a>
例:
- EditPhone_form_1
- EditPhone_form_2
- EditPhone_form_3
- EditPhone_form_4