-
May 8th, 2009, 06:04 PM
#1
Can you give me an Idea on this ?
Hi ,
In my page i need to use two different dropdowns, one is for to display Users and other one is for to display Groups. But at a time only one dropdown will display. For this functionality i am using one more dropdown with values Users and Groups. When i select Users from dropdown only Users related dropdown will display and when i select Groups from dropdown only Groups related dropdown needs to display. Can you give an Idea on this one. ??
Thanks in advance....
-
May 9th, 2009, 02:37 PM
#2
Re: Can you give me an Idea on this ?
Do you ever do any research before posting? Have you gone through any JavaScript tutorials?
This is a very basic concept. Use the onchange attribute of the dropdown to change the CSS of the other two dropdowns.
Code:
<script type="text/javascript">
function changeDropDown(which) {
if (which == "groups") {
document.getElementById('groups').style.display = "";
document.getElementById('users').style.display = "none";
}
else {
document.getElementById('groups').style.display = "none";
document.getElementById('users').style.display = "";
}
}
</script>
<select onchange="changeDropDown(this.value)">
<option value="groups">Groups</option>
<option value="users">Users</option>
</select>
<select id="groups" style="display: none;">
</select>
<select id="users" style="display: none;">
</select>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|