jQuery UI Widgets › Forums › General Discussions › Lists › DropDownList › The problem when two elements on the page with one id
Tagged: id, jqxDropDownList
This topic contains 11 replies, has 3 voices, and was last updated by Peter Stoev 10 years, 7 months ago.
-
Author
-
Hi ci,
This is a normal behavior. The idea of the id is to be absolutely unique identifier.
This article will be helpful for you.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comIf you take for example jqxDateTimeInput, no such problem.
I think the widget should be attached to the object, not the ID
http://jsfiddle.net/ddd06/xcUA3/77/That’s the problem more clearly
http://jsfiddle.net/ddd06/xcUA3/78/Hi ci,
You can use same class names instead same ids.
http://jsfiddle.net/ku5np1kt/
http://jsfiddle.net/6Lvokzvq/Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comThis can bypass, but it’s a bug, is not it?
Hi ci,
It is at least not a bug on our side. ID should be absolutely unique. You should never have HTML Elements with the same ID on a web page.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/solution:
find “jqx.utilities.createId();” in jqxdropdownlist.js
and remove the condition, in my case
change
q.id=q.element.id||a.jqx.utilities.createId();
on
q.id=a.jqx.utilities.createId();Hi ci,
This is not an issue in our widget so do not change our code because it is in violation with the EULA. The ID should be unique so I suggest you to fix your code, instead of modifying ours
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Nevertheless jqxcombobox and other widgets works at the same id
Hi ci,
That does not matter. Your approach is wrong. ID should be unique.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
The topic ‘The problem when two elements on the page with one id’ is closed to new replies.