Skip to content
Building Your Form

Field names, checkboxes, and multiple values

Choose HTML form field names for Qubeforms submissions. Learn checkbox groups, multiple selections, JSON arrays, nested values, and reserved field limits.

1. Choose names that stay consistent

HTML submits a control’s name, not its label, ID, or placeholder. Use simple unique names such as email, message, and order_number. Keep the same names in your website, Reply-To setting, routing rules, and template tokens. Names are case-sensitive. Avoid dots and spaces when you want equivalent HTML and JSON payloads: PHP form parsing can convert them to underscores before Qubeforms receives them. No dashboard field registration is needed to collect an additional named field.

2. Send checkbox groups and selections

Use an array name ending in [] for multiple values in HTML, including checkbox groups and multiple-select controls. Checked boxes contribute their value; unchecked boxes are omitted. Use one shared name without [] for radio buttons that select a single value. This fragment belongs inside your existing form. Selecting both boxes stores an interests array containing product and support.

<fieldset>
  <legend>What would you like to hear about?</legend>
  <label><input type="checkbox" name="interests[]" value="product"> Product news</label>
  <label><input type="checkbox" name="interests[]" value="support"> Support updates</label>
</fieldset>

<label for="contact-method">Preferred contact method</label>
<select id="contact-method" name="contact_method">
  <option value="email">Email</option>
  <option value="phone">Phone</option>
</select>

3. Preserve arrays when using JSON

For JSON, use actual arrays and ordinary property names. Object.fromEntries(formData) keeps only one value per repeated key, so explicitly collect groups with getAll(). An unchecked HTML group is normally omitted; the JSON example deliberately sends an empty array instead. Decide which representation your application expects. When updating drafts, fields merge recursively: sending an empty array does not clear previously saved array entries. See Create and update drafts before using editable checkbox groups in saved steps.

// Inside a submit handler, before disabling any controls:
const fields = new FormData(event.currentTarget);
const payload = {
  email: fields.get('email'),
  interests: fields.getAll('interests[]'),
  contact_method: fields.get('contact_method'),
};
// Send JSON.stringify(payload) with Content-Type: application/json.
// Include your configured honeypot, CAPTCHA, and other control fields as needed.

4. Understand nesting and omitted controls

HTML bracket names such as address[city] become nested data. JSON can send an address object directly. Disabled controls, unnamed inputs, and unchecked checkboxes are not submitted by normal HTML or FormData collection. Use readonly on supported text controls when the value should still be sent. A hidden or readonly field can still be changed by a client; do not treat a submitted price, role, or account ID as authoritative.

5. Respect stored-field limits

Qubeforms removes reserved protocol fields and unsupported name characters, skips empty names and names over 191 characters, trims strings, removes null bytes, and limits strings to 20,000 characters. Arrays keep at most 100 entries per level; excessive nesting is rejected. The encoded field payload limit is 512 KB. Do not use reserved names such as _cf_redirect, _cf_step, or your honeypot name for ordinary visitor answers. Verify the stored record with no, one, and multiple selections before publishing.

Keep private credentials private

Public form keys can appear in browser code. Read keys, management credentials, and webhook signing secrets must stay on the server.