Given that I have some form on a page, I know I can get a unicode serialized string using
var query = jQuery('#some-form').serialize();
It's also possible setting the value of each input with $('#some-input').val(...)
. Assuming that same form above was reset, but I still have the query string - is there a simple way to populate the form from that string? I realize I could parse it and set every input/select individually, but I was looking for a simpler solution. Thanks.
You could serialize the form into a JSON array and use an MVVM mapping plugin like Knockout.js to auto-fill the form.