How to get form input fields as query string in JS

Forums JavaScriptHow to get form input fields as query string in JS
Staff asked 3 years ago

Answers (1)

Add Answer
Staff answered 3 years ago

Use this function

$( "form" ).on( "submit", function( event ) {
  event.preventDefault();
  console.log( $( this ).serialize() );
});

 

Subscribe

Select Categories