{% extends "base.html" %} 
{% block content %}
	<div class="container">
		<div class="text-center">
			<h1>{{ header_text }}</h1>
		</div>
		{%from "_formhelpers.html" import render_field %}
		<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
			{{ search_form.hidden_tag() }}
	        <div class="input-group">
			{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }} 
		    <div class="input-group-btn">
			{{ search_form.submit_search(class="btn btn-success center-block") }}	
		    </div>
		</div>
			
		</form>
		<div id="container_overlay">
			<div id="spinner" class="spinner"/>
		</div>
        </div>
	<script type="text/javascript">
		$(document).ready(function(){
		    $("form input[type=submit]").click(function() {
   		    	$(":text").prop("readonly", true);
   		    	$(":submit").prop("disabled", true);
		        $('#container_overlay').show();	
			$(this).parents('form').submit()
		    });
		});
	</script>
{% endblock %}

{% extends "base.html" %} 
{% block content %}
	<div class="container">
		<div class="text-center">
			<h1>{{ header_text }}</h1>
		</div>
		{%from "_formhelpers.html" import render_field %}
		<form action="{{ url_for( 'select_' + endpoint + '_movie') }}" method="post" name="searchmovie">
			{{ search_form.hidden_tag() }}
	        <div class="input-group">
			{{ render_field(search_form.search,label_visible=false,message=False,placeholder="Fast and furious 7, Les Tuche") }} 
		    <div class="input-group-btn">
			{{ search_form.submit_search(class="btn btn-success center-block") }}	
		    </div>
		</div>
			
		</form>
		<div id="container_overlay">
			<div id="spinner" class="spinner"/>
		</div>
        </div>
	<script type="text/javascript">
		$(document).ready(function(){
		    $("form input[type=submit]").click(function() {
   		    	$(":text").prop("readonly", true);
   		    	$(":submit").prop("disabled", true);
		        $('#container_overlay').show();	
			$(this).parents('form').submit()
		    });
		
		// Force submit button enabling
 	    	$(":submit").prop("disabled", false);

		});
	</script>
{% endblock %}

Fix JQuery bug on submit button disabled status
Fix JQuery bug on submit button disabled status

If we use the browser previous button, it can happen that the submit button to be disabled.
So let's enable the button by default.
