Pregunta

I am working with laravel 3. I have an action button which will open a popup modal.

I have a list of devices. for first page, the popup modal was there. But for second page, the popup modal not coming out but it redirect back to the first page.

index.blade.php code:

{{ HTML::link("devices#openProfile", "Impose Profile", array("id"=>$deviceid,"class"=>"btnSkyBlue","onclick"=>"openImposeProfile($device->id)")) }}

JS:

function openImposeProfile(id) {
document.getElementById("openProfile").style.display="block";
var intentedId = document.getElementById("devId_profile");
intentedId.value = id;
console.log("dev id: "+id+" | intended: "+intentedId.value);
}

¿Fue útil?

Solución

This is how you would do it in L4

<a href="{{ URL::to('devices') }}#openProfile" id="{{ $deviceid }}" class="btnSkyBlue" onclick="openImposeProfile('{{ $device->id }}')">Impose Profile</a>

URL::to might be different in L3

Tip: you should learn jQuery :) it will make your life easier

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top