質問

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);
}

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top