Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To submit multiple values in a single HTML form, you can use either of the following methods:

  1. Using array notation: You can name the form inputs with brackets [] to indicate that they are part of an array. For example:
<input type="text" name="name[]">
<input type="text" name="name[]">
<input type="text" name="name[]">

When the form is submitted, the values of these inputs will be available as an array in whichever programming language you're using to handle the form submission.

  1. Using hidden inputs: You can also use hidden inputs to submit multiple values. For example:
<input type="hidden" name="name" value="John">
<input type="hidden" name="age" value="30">
<input type="hidden" name="country" value="USA">

This method is useful when you need to submit values that the user doesn't need to see or edit, such as IDs or timestamps.