r80488 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80487‎ | r80488 | r80489 >
Date:04:01, 18 January 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added in another character to generated multiple-instance template input names, to reduce chance of name collision
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SemanticForms.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SemanticForms.js
@@ -612,8 +612,10 @@
613613 // the [num] index in the element names with an actual unique index
614614 new_div.find("input, select, textarea").each(
615615 function() {
 616+ // Add in a 'b' at the end of the name to reduce the
 617+ // chance of name collision with another field
616618 if (this.name)
617 - this.name = this.name.replace(/\[num\]/g, '[' + num_elements + ']');
 619+ this.name = this.name.replace(/\[num\]/g, '[' + num_elements + 'b]');
618620
619621 if (this.id) {
620622