{% extends "contact_form/base.html" %} {% load i18n crispy_forms_tags %} {% block title %}{{ block.super }} - {% trans "Contact" %}{% endblock title %} {% block page_title %}{% trans "Contact" %}{% endblock page_title %} {% block content %} {% crispy form %} {% endblock %} {% block extra_js %} <script type="text/javascript"> $(document).ready(function() { if ($('input[type=text]').first().val() != '') { $('textarea').first().focus(); } else { $('input[type=text]').first().focus(); } }); </script> {% endblock extra_js %}