<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script>
        {% if request.method=='POST' %}
            {% if request.form['username'] %}
                alert('Your username is {{ request.form['username'] }}')
            {% endif %}
            {% if request.form['password'] %}
                alert('Your password is {{ request.form['password'] }}')
            {% endif %}
        {% endif %}

    </script>
</head>
<body>
<form action="{{ url_for('home') }}" method="POST">
    <label>Username<input name="username"/></label>
    <label>Password<input name="password"/></label>
    <input type="submit"/>
</form>
</body>
</html>