$(function(){ $('#f_k_templates').on( "change", function(){ var $this = $( this ); var link = ''; var tpl = $this.val(); if( tpl != -1 ){ link += '&tpl=' + tpl; } document.location.href = link; }); });