drop down hiding/showing selections
Hey Jason
Am trying to modify this to show different elements based on the drop down selection.
My drop down consists of 'Sponsors', 'Premium', 'Exhibitors' and 'Media'
SponsorsName is visible to all three
If you select 'Premium' the SponsorsLink input only (as well as SponsorsName)
If you select 'Sponsor' or 'Media' the SponsorsLink input and SponsorsImage upload should show (as well as SponsorsName)
I have tried playing around with the code that you showed me on this thread - http://www.webassist.com/forums/posts.php?id=35445 - but cant get it to work based on the above criteria.
so far I have
<script type="text/javascript">
function setTextField() {
var theList = document.getElementById("SponsorsType");
var theText = document.getElementById("SponsorsLink");
var theSelectedValue = theList.options[theList.selectedIndex].value;
if((theSelectedValue == "Sponsor") || (theSelectedValue == "Premium") || (theSelectedValue == "Media")) {
theText.style.display = "block";
} else {
theText.style.display = "none";
}
}
</script>
which shows 2 fields, SponsorsName (by default) for all 4, but only the SponsorsLink for 'Sponsors', 'Premium' - whatever I have tried I cannot get it to work based on if Sponors is selected, then all three elements show.
Also, in the attached _update page, if I navigate to it and the entry is, for example either a premium or sponsor entry, then the hidden fields arent showing by default. You have to toggle them on by using the drop down.
As always, many thanks
Jamie