Hello,
The script is below for your review. I’m trying to open and close the div tags based on the menu selections. for testing purpose it only setup to close the div tag. the current script on closes the first div tag and the rest does nothing… not sure what im doing. any help you can provide would be greatly appreciated. thank you.
This script pulls in menu values from db for display.
example menu: Add New Member1 | Modify Existing Member2 | Member Lookup3
<ul class="navH_memberUpdate" >
<?php
foreach($get_navManageMemberListing as $manageList) {
echo '<li value="'.$manageList['mgn_index'].'" id="test1" > <a href="#" >'.$manageList['mgn_manageMember'].$manageList['mgn_index'].'</a></li>';
}
?>
</ul>
<!-- looking to have the div tags open/close based on the menu selection -->
<div id="ID_modifyDIV1" >
<h3>Div 1</h3>
<div style="border: 1px solid green">new user</div>
</div>
<br>
<div id="ID_modifyDIV2" >
<h3>Div 2</h3>
<div style="border: 1px solid green">Modify user</div>
</div>
<br>
<div id="ID_modifyDIV3" >
<h3>Div 3</h3>
<div style="border: 1px solid green">Lookup</div>
</div>
<br>
JavaScript component, for now it only closes the div tag (testing)
$(document).ready(function() {
$("#test1").click(function(event) {
event.preventDefault();
var testX = document.getElementById("test1").value;
if(testX ==1) {
document.getElementById("ID_modifyDIV1").style.display = "none";
}
if(testX == 2) {
document.getElementById("ID_modifyDIV2").style.display = "none";
}
if(testX == 3) {
document.getElementById("ID_modifyDIV3").style.display = "none";
}
});
});