Pls I need someone to help me out on the code below: Here is what I want to achieve. When the page loads, It should only show the link view avaliable wards.When the user clicks that link, then It should load the php file(' ward_availability.php'). Also, the intial javascript should aditional function of hide/show the ward_availability.php when toggles.
For now, it loads upon opening the page, so how do I unload, then user click, then load and when user clicks again, it hides.Pls assist.
<script type="text/javascript">
function toggleVisible(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
</script>
<script type="text/javascript">
$(document).ready(function(e) {
$('#wardAv').load('ward_availability.php');
});
</script>
<a href="#" target="_top" onclick="toggleVisible('wardAv')">View Available Ward</a>
<div id="wardAv">
Ward will be loaded here
</div>