send-wp-mail/js/sefa.js
2015-10-29 18:31:00 +00:00

11 lines
445 B
JavaScript

jQuery( document ).ready( function( $ ) {
$("#sefa-user-list").change( function() {
$recipients = $("#sefa-recipient-emails");
if ( $recipients.val() == '' ) {
$recipients.val( $(this).find("option:selected").attr("value") );
} else if ( $(this).val() != '' ) {
$recipients.val( $recipients.val() + ',' + $(this).find("option:selected").attr("value") );
}
$(this).find("option:selected").attr("disabled","disabled");
})
} );