I'm trying to get a script to work where when a person selects an option from a dropdown <select> list more options appear. At present it doesn't even look like the browser is listening for the event. You can see it live at: http://ccms.cteens.org/admin/dev/admin.php?id=addevent
Here is the code:
the html
the jsCode:<select name="the_repeat" onchange="showrepeat(window.document.add_event.the_repeat.selectIndex.value);"> <option value="0">No Repeat/Daily</option> <option value="2">Weekly</option> <option value="3">Monthly</option> </select>
Thanks for your help.Code:function showrepeat(i) { var a = 'weekly_repeat'; var b = 'monthly_repeat'; if (document.getElementById) { var abra = document.getElementById(a).style; var kadabra = document.getElementById(b).style; if (i == 0) { abra.display = "none"; kadabra.display = "none"; } else if (i == 1) { abra.display = "block"; kadabra.display = "none"; } else if (i == 2) { abra.display = "none"; kadabra.display = "block"; } return true; } else { return true; } }



Reply With Quote

Bookmarks