我想将表单名称传递给函数,然后确认它们已被读取以删除它,然后我想更改操作然后提交表单。
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