jQuery deserialize form

后端 未结 11 812
日久生厌
日久生厌 2020-12-13 09:21

I am using jQuery Serialize to serialize my form elements and would like to deserialize them back. Unfortunately can\'t find any working jQuery deserializer, any suggestions

11条回答
  •  我在风中等你
    2020-12-13 09:43

    Using Jack Allan's deparam function with jQuery, you can change this line:

    map[key] = value;
    

    to

    $('input[name=' + key + ']').val(value);
    

    Which will load the data back into your form fields.

提交回复
热议问题