Quite often I have the need to represent structured objects in HTML forms, for example I’d like to be able to represent the following structure:
interface Reservation {
attending: boolean;
guests: Guest[];
}
interface Guest {
firstName: string;
lastName: string;
}
I’ve often seen square bracket and dot notations used to represent such data structures in HTML forms, for example:
<form>
<select name="attending">
<option value="true">Yes</option>
<option value="false">No</option>
</select>
<input type="text" name="guests[0].firstName">
<input type="text" name="guests[0].lastName">
<input type="text" name="guests[1].firstName">
<input type="text" name="guests[1].lastName">
</form>
My question is, is this notation based on any standard? If so which standards are available? I am specifically looking for a solution that parses this form data structure on the server-side, without adding any client side JavaScript.