@@ -128,9 +128,9 @@ will look like this:
128
128
129
129
.. code-block :: html
130
130
131
- <input type =" email" id =" form_emails_$$name$$ " name =" form[emails][$$name$$ ]" value =" " />
131
+ <input type =" email" id =" form_emails___name__ " name =" form[emails][__name__ ]" value =" " />
132
132
133
- By replacing ``$$name$$ `` with some unique value (e.g. ``2 ``),
133
+ By replacing ``__name__ `` with some unique value (e.g. ``2 ``),
134
134
you can build and insert new HTML fields into your form.
135
135
136
136
Using jQuery, a simple example might look like this. If you're rendering
@@ -171,10 +171,10 @@ you need is the JavaScript:
171
171
172
172
// grab the prototype template
173
173
var newWidget = emailList.attr('data-prototype');
174
- // replace the "$$name$$ " used in the id and name of the prototype
174
+ // replace the "__name__ " used in the id and name of the prototype
175
175
// with a number that's unique to our emails
176
176
// end name attribute looks like name="contact[emails][2]"
177
- newWidget = newWidget.replace(/\$\$ name \$\$ /g, emailCount);
177
+ newWidget = newWidget.replace(/__name__ /g, emailCount);
178
178
emailCount++;
179
179
180
180
// create a new list element and add it to our list
@@ -284,8 +284,8 @@ This option is useful when using the `allow_add`_ option. If ``true`` (and
284
284
if `allow_add `_ is also ``true ``), a special "prototype" attribute will be
285
285
available so that you can render a "template" example on your page of what
286
286
a new element should look like. The ``name `` attribute given to this element
287
- is ``$$name$$ ``. This allows you to add a "add another" button via JavaScript
288
- which reads the prototype, replaces ``$$name$$ `` with some unique name or
287
+ is ``__name__ ``. This allows you to add a "add another" button via JavaScript
288
+ which reads the prototype, replaces ``__name__ `` with some unique name or
289
289
number, and render it inside your form. When submitted, it will be added
290
290
to your underlying array due to the `allow_add `_ option.
291
291
0 commit comments