Skip to content

Commit 881d2fa

Browse files
committed
consistent containid for better integration with form validation.
1 parent c65355e commit 881d2fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@
559559
this.enabled=true;
560560
this.container = this.createContainer();
561561

562-
this.containerId="s2id"+nextUid();
562+
this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
563563
this.container.attr("id", this.containerId);
564564

565565
// cache the body so future lookups are cheap

0 commit comments

Comments
 (0)