jQuery / JavaScript Bubbling and stopPropagation doesn't work -


I am creating an editing button that pops up a modal box with a form to edit it. JQuery then sends this form to my server and I get a JSON response back. However, due to my bubbing issue, if I click on, for example, click on all the edit button and then the last time and change a field, it all happens in this. Click

  $ ('edit') (function (event) {// more code ... modal_submit (the_id); event.stopPropagation ();});  

and then submit event:

  function modal_submit (the_id) {$ ('# modal form'). Submit (function () {// Every time I click on the Edit Button Alert (the_id), returned false ;;};  

}

< P> Finally all of this is inside the Hossole:

  $. GetScript ('js / edit.js', function () {create_edit_btn ();  
< P>});

I have used only one more time, and it works, but I had to do this. Event.stopPropagation, but if I "do this" now it says The event has not been defined, but as I said it The wrong code used to work for the other script before.

Does anyone have any ideas ?:

Edit:

  is html : 
  • Input id = "item 1" type = "checkbox" value = "web hosting | 15" title = "web hosting"> <<> for your website Hosting & lt; / li & gt;
  • There can be multiple event listeners in an event every time you use $ (Element). Submit (whatever function) you are adding to the submitted event and whatever. If you only want the final listener to take action on the occurrence of the event, then try doing this:

      function modal_submit (the_id) {$ ('# modal form'). (); // This will remove all other event listeners from this element $ ('#model form'). Submit (function () {// every time I click on Edit button alert (the_id);});  

    Comments

    Popular posts from this blog

    c# - ListView onScroll event -

    PHP - get image from byte array -

    Linux Terminal Problem with Non-Canonical Terminal I/O app -