HI Cannot check it at present as away form main computer etc, but The only things e have not touched on are your JS actions:
function show(target) {
event.preventDefault();
document.getElementById(target).style.display = 'block';
}
function hide(target) {
event.preventDefault();
document.getElementById(target).style.display = 'none';
}
The effect event.preventDefault(); will have not effect as there is no event being past. Best to use return false; Either within the the functions or on the onclick event.
onclick="show('hidediv'); return false;"
Also you are giving it a target and if you list has more than one hidedivthen it still wont do this to the one you require it will basically find the first instance of hidediv and target that.
So this is why its probably showing the first task when you click the edit button, so me thinks this could be your JS functions not firing as they should.
To target the actual section your on need to be looked at even if you add an interator id to the div name
<td id="hidediv{{ $number }}">
<div id="hidediv-container">
......
<a type="button" class="btn btn-success" onclick="show('hidediv{{ $number }} '); return false;"....
So that each DIV id is unique so easier to target within the js.
You will need to work out how to create the $number interator etc
Actually you could use the $task->id
<td id="hidediv{{$task->id}}">
<div id="hidediv-container">
......
<a type="button" class="btn btn-success" onclick="show('hidediv{{ $task->id}} '); return false;"....
So each div would be <td id="hidediv2"... <td id="hidediv3... etc
Hope this helps.