Skip to content

Commit a495615

Browse files
author
marc.weistroff
committed
[Form] Replaced $ by jQuery and changed phrasing.
1 parent 43cb090 commit a495615

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

book/forms.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,14 +931,15 @@ and insert it in the form. Here is a sample that you will have to adapt.
931931
.. code-block:: javascript
932932
<script type="text/javascript">
933933
jQuery('#add-element').click(function() {
934-
var prototype = $('form#my_form #my_collection').attr('data-prototype');
934+
var prototype = jQuery('form#my_form #my_collection').attr('data-prototype');
935935
936936
// the level of the prototype is replaced by $$name$$
937-
// you have to change this to the number of items + 1
937+
// you might have have to change this to be coherent
938+
// with your row ordering.
938939
prototype = prototype.replace(/\$\$name\$\$/g, '00');
939940
940941
// Append the prototype to the DOM
941-
$('#my_prototype').append(prototype);
942+
jQuery('#my_prototype').append(prototype);
942943
});
943944
</script>
944945

0 commit comments

Comments
 (0)