What is the best way to parse through each input on a form to produce the Json object below? I am not married to the custom Attributes, if the is a better simpler way please share it.
<form>
<label>Address</label>
<input type="text" name="address" data-label="Address" data-group="partcipantInfo" data-column="dataBaseAddress" data-internalUse="1" data-userDefined="0" value="123 Acme Way"/>
<label>City</label>
<input type="text" name="City" data-label="City" data-group="partcipantInfo" data-column="dataBaseCity" data-internalUse="1" data-userDefined="1" value="Loony Tunes"/>
<input type="submit"value="Submit" />
</form>
Trying to get this result for each
{
"inputs":[
{
"DataLabel":"Address",
"DataGroup":"Address on Record",
"DataColumn":"DataBaseAddress",
"Value":"123 Acme Way",
"InternalUse":true,
"userDefined":false
},
{
"DataLabel":null,
"DataGroup":"Address on Record",
"DataColumn":"dataBaseCity",
"Value":"Loony Tunes",
"InternalUse":true,
"userDefined":true
}
]
}