When I run the code the click event works the first time. When I click it more then one time it seems that the click even has unbounded. How do I keep the click event bounded?
var Categories = function() {
$("select[id^='CategoryListBox-']").click(
function() {
SelectedItem = $(this).val();
$(this).parent().load('/Categories/CategoryPicker?CatID=' + SelectedItem);
//send CatID to the requesting page
$('form#SubmitPost').prepend('<input id="CatID" name="CatID" type="hidden" value="' + SelectedItem + '" />');
});
}
Categories();