how to get form values on submit using Javascript?

Submitted 3 years, 5 months ago
Ticket #272
Views 217
Language/Framework Javascript
Priority Low
Status Closed

And after submission an alert of "submitted successfully"  should be displayed on top the screen..

Submitted on Oct 31, 20
add a comment

2 Answers

Verified

The jquery form plugin offers an easy way to iterate over your form elements and put them in a query string. It might also be useful for whatever else you need to do with these values.

var queryString = $('#myFormId').formSerialize();

From http://malsup.com/jquery/form

Or using straight jquery:

var queryString = $('#myFormId').serialize();

Submitted 3 years, 5 months ago

If you want just a normal pop up button, you could do the following :

 

$('form').on('submit',function(){
           alert('submitted successfully!');
});

Submitted 3 years, 5 months ago


Latest Blogs