Skip to content

Instantly share code, notes, and snippets.

@BriceShatzer
Created May 19, 2020 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BriceShatzer/6f6fe44493c80233734afe15ed4df8c4 to your computer and use it in GitHub Desktop.
Save BriceShatzer/6f6fe44493c80233734afe15ed4df8c4 to your computer and use it in GitHub Desktop.
<source lang="html5">
<!DOCTYPE html>
<html>
<head>
<title>Foo Bar Baz Qux</title>
</head>
<body>
<form id="form1" >
<input type="text" name="foo.bar" value="abc" />
</form>
<form id="form2" >
<input type="text" name="foo.bar" />
<input type="text" name="foo.baz.qux" />
<input type="text" name="qux" />
</form>
<script>
var form1 = readFormObject('form1');
var form2 = readFormObject('form2');
//so that
/*
var form1 = {
foo : {
bar : 'abc'
}
}
var form2 = {
foo : {
bar : '',
baz : {
qux : ''
}
},
qux : ''
}
*/
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment