Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery click function and ajaxcomplete not working.

 
Javan Roberts
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I would appreciate any help with this little issue I'm having.. I'm trying to use jQuery ajax along side twitter bootstrap and I cannot get the modal to function properly. When I remove the $("#process").modal("show"); from the script the modal will still show, when I leave the $("#process").modal("show"); in, it will show for a split second and then disappear. I also have $("#process").modal("hide"); on a document ajaxcomplete function, yet it wont hide, but the ajaxcomplete alert is firing. What am I doing wrong?

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
id is singular, you can not have two or more items with the same id.

And I do not see you cancelling the click action.

Eric
 
Javan Roberts
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah ok, thank you, that would explain why I couldn't get the second button to fire. What would be the correct syntax to target each button if I change their id's to id="dpp_button-1" and id="dpp_button-2". I've tried this:
Also, It seems like the data-toggle="modal" in the anchor tag was the culprit, it looks like they were canceling each other out.

Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic