mardi 10 mars 2015

Accessing SQLite data through Javascript?

For example, if I have this code:



<form action="{{ url_for('user.new_domain') }}" class="form" role="form" method="post" action="" autocomplete="off">
{{ form.csrf_token }}
<p>{{ form.name(placeholder="name", onkeyup="timing()") }}
<span class="error">
{% if form.name.errors %}
{% for error in form.name.errors %}
{{ error }}
{% endfor %}
{% endif %}
</span>
</p>
</form>


timing() is a function within a javascript file that I have inside a <script> tag in my code. I want timing() to be able to access my sqlite database info and check to see if whatever the user entered into the form exists in my database. Is this even the right way to do this? Through javascript? how else am I supposed to run javascript functions that are dependent on sqlite data? Any help is appreciated. Thanks!


Aucun commentaire:

Enregistrer un commentaire