0

I have:

{{ Form::select("toLeague",$select_leagues,null, ['class' => 'selectpicker']) }}

I want to do each league in $select_leagues as a link with it's id like:

<a href="league/albums/{league->id}">

How to do this?

Rwd
  • 34,180
  • 6
  • 64
  • 78
Azhar Nabil
  • 73
  • 11
  • You can't use links inside a select! One option would be to use javascript to redirect on change of the select. – Rwd Nov 22 '16 at 15:32

1 Answers1

1

You need use onchange javascript event and redirect

$(document).ready( function() {
   $('#idSelect').change( function() {
      location.href = 'league/albums/'+$(this).val();
   });
});

Or using jquery:

$('#idSelect').bind("change keyup",function()
{

  window.location = 'league/albums/'+$(this).val();
});
migueref
  • 302
  • 1
  • 7