Skip to content

RuneLabAI/htmx-json-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

htmx: JSON form extension

This htmx extension provides a more convenient way to send complex JSON via forms.

It provides a convenient syntax to create nested objects, without ever having to manually add array indices.

Examples

Simple nested object

<input name="title">
<input name="author.name"> <!-- Nesting with dots -->
<input name="author[bio]"> <!-- Nesting with brackets -->

Arrays

<input name="url">
<input name="url">
<input name="url"> <!-- Simply repeat a property -->

<input name="title[]">
<input name="title[]">
<input name="title[]"> <!-- Array indicator -->

Array of objects

<input name="articles[][title]">
<input name="articles[][category][]">
<input name="articles[][category][]"> <!-- nested objects and arrays -->

<input name="articles[+][title]"> <!-- Plus marks the start of a new object -->
<input name="articles[][category][]">

About

A versatile way to send JSON via forms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published