Select2 JS OnChange Value

$("select").select2({ placeholder: "Search Value...", allowClear: false, closeOnSelect: true }).on('change.select2', function(e){ var url = $(this).val(); if (url) { window.location = url; } return false; });
Select2 is jQuery replacement for Select boxes...
https://select2.github.io

I have URL value on my select field and need to redirect the value into page whenever they select it.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.