29

Is there any way I can put a break point on chrome developer tool so that the screen is paused when I click submit button? In precise how to break on submit action?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
user3127042
  • 391
  • 1
  • 3
  • 4

1 Answers1

64

I posted a very similar answer that details how to enable specific event listener breakpoints in Google Chrome Dev Tools.

In the dev tools, go to the Sources tab, and look in the right-hand column with the expandable/collapsible sub-panes. Expand the one called Event Listener Breakpoints. Under here are expandable checkbox selections that allow you to tick any events that you wish to listen for. Once you check any of them, Chrome will break in JS code as soon as an event of that type occurs.

You specifically want the submit event under the Control group. Expand Control, and tick submit, as shown in the image below (the box on Control is added automatically to indicate that some, but not all, of the items under it are ticked). Chrome's dev tools should then hit a dynamic breakpoint immediately any time a submit event occurs.

Chrome Dev Tools Submit Event Breakpoint

Fun fact: I still had submit ticked when I clicked the button to post this answer, and Chrome hit a breakpoint :).

Community
  • 1
  • 1
ajp15243
  • 7,704
  • 1
  • 32
  • 38
  • 3
    @user3127042 You're quite welcome. Please make sure to [mark an answer as accepted](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) if it solves your problem, so that others can see that it is marked as solved and can benefit from the solution. – ajp15243 Jan 18 '14 at 19:30