How to halt form submission until user agreement is accepted? : On many websites I saw such approach:

You fill a registration form.

And press submit button.

Then you see a modal with user agreement (or smth similiar), which you have to accept to continue.

Browsing through SO and google search I've found nothing looking like a solution and hardly like a clue... I would appreciate your help!