Surface form



  • I have a form of exit:

    <form action="LogoutServlet" method="post">
        <input type="submit" value="Logout" >
    </form>
    

    But I want to use the reference. <a href="xxx" ...> </a> instead of form. How do I get it?



  • You can't use POST requests, only GET♪ If there is a way to make the shape processor work, GET Parameters, the reference is easy to make:

    <a href="LogoutServlet?submit=Logout">Выйти</a>
    

    If the processor cannot be touched, then the form may be invisible and, upon application, the form should be sent:

    <form id="logout" action="LogoutServlet" method="post">
        <input type="hidden" name="logout" value="submit"> 
    </form>
    <a href="#" onClick="$('#logout').submit()">Выйти</a>
    

    Or you can take the form completely. javascript♪ Don't forget to connect. https://jquery.com/ ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2