function setHiddenAction(element) {
var okToSubmit = false;
//A. Make sure that the user selects at least one item before they Request an Action
if( $("input:checkbox:checked").length > 0 ) okToSubmit = true;
//B. Set the Hidden Value to the Users Requested Action
$("#action").attr("value", element.value)
//C. Either Submit or give an Error Message
if( okToSubmit ) {
$("form").submit();
} else {
alert( "Please select at least one item" );
}
}
setHiddenAction("email");