Monday, 25 April 2022

Form data to table

I've been doing a fair bit with jQuery's serialize() recently but found myself looking for a way to display the values before submitting them via an ajax() request. A friendly and straightforward method is to take advantage of console.table() to do the heavy lifting:

console.table(Object.fromEntries(new URLSearchParams($form.serialize())))

No comments:

Post a Comment