diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 0c86877850d..c1f270c9e82 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -179,7 +179,9 @@ you need is the JavaScript: var emailCount = '{{ form.emails|length }}'; jQuery(document).ready(function() { - jQuery('#add-another-email').click(function() { + jQuery('#add-another-email').click(function(e) { + e.preventDefault(); + var emailList = jQuery('#email-fields-list'); // grab the prototype template @@ -192,9 +194,7 @@ you need is the JavaScript: // create a new list element and add it to the list var newLi = jQuery('
  • ').html(newWidget); - newLi.appendTo(jQuery('#email-fields-list')); - - return false; + newLi.appendTo(emailList); }); })