Framework: Flask, Problem: Everytime i submit form and reload the page, form is published even if the content of form is blank

  flask, forms, javascript

So like in title, i have some problems with form

  • Flask (1.1.2)

I tried to clear value of form by clicking button "Publish" but I don’t know why script is not executing on click.

Java Script is well implemented

<script type=text/javascript src="{{ url_for('static', filename='js/main.js') }}"></script>

But button with argument ‘onClick’ isn’t executing the function ‘clear()’

<button type="submit" class="btn btn-success" id="submit" onclick="clear()">Publish</button>

How it looks like on page after i reload

Source: Ask Javascript Questions