我动态创建了一个表单列表,但在提交用户之前会收到一个 jquery 确认警报。我想在此确认文本中提及一个表单值,但我不知道如何执行此操作
<form name="team_uit_laddercompetitie_zetten_frm" method="post" class="confirm_submit">
<input type="hidden" name="todo" value="team_uit_laddercompetitie_zetten" />
<input type="hidden" name="teamID" value="<?php echo $aKlasse[$k]['teamnr'];?>" />
<input type="hidden" name="teamnaam" value="<?php echo teamnaam($aKlasse[$k]['teamnr']);?>" />
<input type="submit" id="team_uit_laddercompetitie_zetten_submit" value="TEST: uit competitie zetten" />
</form>
这是我的 jquery 部分:
<script type="text/javascript">
$(".confirm_submit").click( function(){
var test = $this.form.teamnaam.value;
jConfirm('xWeet u zeker dat u het team: uit de laddercompetietie wilt verwijderen?' + test, function(r) {
if(r == true)
{
//$('#team_uit_laddercompetitie_zetten_frm').submit();
alert('test');
return true;
}
else
return false;
});
return false;
});
</script>