$(function()
{	
	$("#revocation_search_form_field").on("input", function()
	{
		if($("#revocation_search_form_field").val() !== "")
		{
			$("#revocation_search_form_clear_button").css("display", "block");
		}
		else
		{
			$("#revocation_search_form_clear_button").css("display", "none");
		}
	});

	$("#revocation_search_form_field").on("keydown", function(event)
	{
		if(event.keyCode === 13)
		{
			event.preventDefault();
			$("#revocation_form").submit();
		}
	});

	$("#revocation_search_form_clear_button").on("click", function(event)
	{
		event.preventDefault();
		$("#revocation_search_form_field").val("");
		$("#revocationq_search_form_clear_button").css("display", "none");
	});

	$(".revocation_table_header").on("click", function(event)
	{
		$("#revocation_sort").val($(this).data("type"));
		$("#revocation_order").val($(this).hasClass("reverse") ? "desc" : "asc");
		$("#revocation_form").submit();
	});
});