/* Add usernames to the one of the fields supported */ Drupal.og_username_helperAutoAttach = function() { $("#edit-og-username-helper-add-button").click(function() { if ( $("#edit-og-username-helper-text").val() != undefined ) { var coma=','; if ( $("#edit-mails").val() != undefined) { if ( $("#edit-mails").val() == '') coma=''; $("#edit-mails").val($("#edit-mails").val()+coma+$("#edit-og-username-helper-text").val()); } else if ( $("#edit-og-names").val() != undefined ) { if ($("#edit-og-names").val()=='') coma=''; $("#edit-og-names").val($("#edit-og-names").val()+coma+$("#edit-og-username-helper-text").val()); } $("#edit-og-username-helper-text").val(''); } return false; }); } if (Drupal.jsEnabled) { $(document).ready(Drupal.og_username_helperAutoAttach); }