Search code examples
pythonhtmlcherrypy

To make form tag with submit doesn't open a new page/window


So, there is an ordinary example of form tag usage:

<form name="form_name" action="${url}" method="POST">`
    <input type="text" name="email_input" id="email_input" class="input">
    <input type="submit" name="send" class="send_ticket">
</form>

How can you see, I use Mako in action value and Python web framework CherryPy. So, this code works fine: I push the button, data is sent to a server then a new tab is opened. But I requares in no displaying a new tab in my browser. I want to stay on my current tab.

How can I do it? Thanks.


Solution

  • This task is resolved by using redirectToRoute function.