Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Falah Al Fitri
Falah Al Fitri

Posted on • Edited on

     

jQuery Form multi submit preventDefault()


Happy Coding

https://stackoverflow.com/questions/11609295/jquery-submit-multiple-forms-in-a-page/59317426#59317426

/* get all form and loop */$( "form" ).each( function () {    /* addEventListener onsubmit each form */    $( this ).bind( "submit", function (event) {        /* return false */        event.preventDefault();        var form = event.target;        /* display each props of forms */        console.log( form ); // object formHTML        console.log( "form id: " + form.id );        console.log( "form action: " + form.action );        console.log( "form method: " + form.method );    } );});
Enter fullscreen modeExit fullscreen mode

Demorepl.it

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I am Developer
  • Location
    Marabahan, Indonesia
  • Education
    S. Kom of UNISKA Banjarmasin
  • Work
    Toy Seller
  • Joined

More fromFalah Al Fitri

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp