[英]How to click a hyperlink(<a> tag) automatically by clicking only a submit button in html?
<input type='submit' name='btnAdd' onclick="{{ route('eventCal_index', $_SESSION['title']) }}" value='Add event' >
Submit button should be both work for submission and navigate to that route 提交按钮应该既可以提交,又可以导航到该路线
That means without clicking the hyperlink, by clicking the submit button I want to click another link automatically. 这意味着无需单击超链接,只需单击“提交”按钮,即可自动单击另一个链接。 Simply, Is there a way to click a hyperlink(
<a>
tag) automatically 简单来说,有没有一种方法可以自动单击超链接(
<a>
标签)
In the route function at the end of it add 在路由功能的末尾添加
$("#linkid").trigger('click');
Please see this page for more details:- http://www.w3schools.com/JQuery/event_trigger.asp 请参阅此页面以获取更多详细信息:-http: //www.w3schools.com/JQuery/event_trigger.asp
Try this //on submission of form ,you can trigger click event. 尝试此///在提交表单时,您可以触发click事件。
$('form').on('submit',function()
{
$('a').trigger('click');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.