Created
September 5, 2020 11:06
Convert Form Data into JSON formate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Return Form Data in json formate. | |
require jQuery Form Selector | |
*/ | |
function returnFormJson(fromSelector) { | |
var output = []; | |
var f_Data = $(fromSelector).serializeArray(); | |
for (var i = 0; i < f_Data.length; i++) { | |
output[f_Data[i]["name"]] = f_Data[i]["value"]; | |
} | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment