Я пытаюсь отправить форму определенного элемента на моей веб-странице, но я получаю
Uncaught TypeError: Cannot read property 'form' of undefined
Это скрипт JavaScript для моей веб-страницы.
<script type="text/javascript">
var aTags = document.getElementsByName("s");
for (var i=0;i<aTags.length;i++){
aTags[i].addEventListener('click', function(e){
e.preventDefault();
bootbox.confirm({
message: "This is a confirm with custom button text and color! Do you like it?",
closeButton: false,
buttons: {
confirm: {
label: 'Yes',
className: 'btn-success'
},
cancel: {
label: 'No',
className: 'btn-danger'
}
},
callback: function (result) {
if(result){
aTags[i].form.submit();
}
}
});
});
}
</script>