OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions jquery event called twice

This topic contains 2 replies, has 2 voices, and was last updated by  thinh2010 6 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34441

    thinh2010
    Participant

    Hi everybody,

    I got a problem about jquery.
    I create an event listener each time my checkbox is changed. And the event always call twice.

    My code alert twice, ‘checked’ and ‘unchecked’.

    Do anyone got also this pb?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #34442

    msulima
    Moderator

    Hi, thinh2010.

    Your got the twice alert, because that element already have some listener that do something like

    To add your own event listener and disable all other listeners you can use

    But you do that at your own risk. Disabling some other listeners can bring some bugs in functional of that elements.


    #34443

    thinh2010
    Participant

    Hi, thank for your reply. I already found the problem.

    Because I added attribute class to field in form

    and this class add twice in frontend. 1 in container and 1 in input. So that it called twice.

    I replaced the class by

    and it works.

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top