weixin_33699914 2018-01-24 09:34 采纳率: 0%
浏览 15

在动态链接上提交表格

Here is the code below which i am using to submit my form. When i click the link, the new window is behaving as current window and the Current window is behaving as new action link. How can i stop this behaviour.

I am reading the linkURL in a java class from JVM parameters.

<form action="<c:out value='${config.linkURL}'/>" method="GET" id="myForm">
    <a href="#" target="_blank" id="myLink"><bean:message key="link.cardholder.info"/></a>
    <input type="hidden" name="cardID" value="<c:out value="${config.homeSwitch}"/>" />
    <script>
         $('#myLink').on('click', function() { window.open('<c:out value="${config.linkURL}"/>',"title").focus();});
    </script>
</form>

when i tried here the hidden values are not passing along with the url because of not calling submit() function. Any possible way to call submit function.

  • 写回答

1条回答 默认 最新

  • Memor.の 2018-04-09 02:04
    关注

    This link will provide you with detailed info about the HTMLFormElement.

    This link will explain what the submit method of the HTMLFormElement is.

    Something like:

    myForm.submit();
    
    评论

报告相同问题?