Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8931249

Browse filesBrowse files
flip111wouterj
authored andcommitted
Cleaned up javascript code
1 parent 06e7c5f commit 8931249
Copy full SHA for 8931249

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎reference/forms/types/collection.rst

Copy file name to clipboardExpand all lines: reference/forms/types/collection.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ you need is the JavaScript:
179179
var emailCount = '{{ form.emails|length }}';
180180

181181
jQuery(document).ready(function() {
182-
jQuery('#add-another-email').click(function() {
182+
jQuery('#add-another-email').click(function(e) {
183+
e.preventDefault();
184+
183185
var emailList = jQuery('#email-fields-list');
184186

185187
// grab the prototype template
@@ -192,9 +194,7 @@ you need is the JavaScript:
192194

193195
// create a new list element and add it to the list
194196
var newLi = jQuery('<li></li>').html(newWidget);
195-
newLi.appendTo(jQuery('#email-fields-list'));
196-
197-
return false;
197+
newLi.appendTo(emailList);
198198
});
199199
})
200200
</script>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.