我的html中有一个表单,但它不起作用。我怎么能找到原因?
这是我的HTML:
<form action="DoMakeApplication" method="post" id="my-form" onsubmit="alert('Başvurunuz alınmış ve yetkililere iletilecektir. Teşekkürler.');" >
<input type="hidden" th:value="${jobAdvert.company.companyName}" name="companyName" ></input>
<input type="hidden" th:value="${jobAdvert.company.id}" name="companyId" ></input>
<input type="hidden" th:value="${jobAdvert.id}" name="advertId" ></input>
<button class="btn type7 color1" type="submit" id="makeApplication" >Başvur</button>
</form>
答案 0 :(得分:0)
我无法弄清楚真正的问题是什么,但尝试使用按钮输入按代码提交表单:
<form action="DoMakeApplication" method="post" id="my-form">
....
<input type="button" value="Submit form" onclick="doSubmit()" />
....
</form>
并实现javascript函数:
function doSubmit(){
document.getElementById("my-form").submit();
};
希望它能解决你的问题;)