The HTML form to structured data pattern


This week I received a lot of submissions to airportpianos.org, the index of pianos in airports that I maintain. Submissions come through a Google Form. The form is intentionally brief , asking for two pieces of information: the airport name and the location of the piano.

When I receive a submission, I fill out a JSON entry and add it to the list of pianos. This list is then used to generate the static airportpianos.org web site. You can see the raw data used to generate the site on GitHub.

I regularly make small errors when adding new entries by hand. The most common one is adding a comma to the end of a JSON entry — which you can’t do! — or forgetting a comma after a value where one is needed.

This week I created a web form that generates the JSON record for me. The form is a static HTML page. When you submit the form, a JavaScript script reads the contents of the form fields and generates the JSON record that I can then paste into the list.

A section of the Add a Piano admin form showing several form fields, including the airport name, IATA code, and city where the airport is located

The form has a few addiitonal features. FIrst, if I type an IATA code — an “airport code” — that is already listed on the site, I get a warning to tell me the entry already exists. This will prevent me from making duplicate entries, and make sure I go to check the existing information to make sure it matches the most recent submission for the airport piano.

Second, I added two links:

  • Search for IATA
  • Search for lat long

The former takes the name of the airport and creates a Google Search link for {airport name} airport code. Google usually returns a big box showing the airport code, which makes data entry easier for me. The same is true of latitude and longitude, too.

A big results box on Google Search showing the airport code for Edinburgh Airport, EDI

Here is an example of a final record generated by the web form:

{
    "iata": "CPH",
    "title": "Copenhagen Kastrup International Airport",
    "city": "Copenhagen",
    "state": "Copenhagen",
    "country": "Denmark",
    "lat": "55.6120",
    "long": "12.6477",
    "zoom": "12",
    "hasPiano": "true",
    "pianoShortLocation": "Terminal 3",
    "lastConfirmed": "2025",
    "description": "There is a piano for public use located at Terminal 3.",
    "slug": "cph"
}

The record is valid JSON that I can add to the list of pianos.

This implementation follows the same principles behind my publish tool that I use to publish blog posts on my site: create a web form that, with JavaScript, generates data in the structure that a static site generator expects.



Source link

Visited 1 times, 1 visit(s) today

Related Article

Lorenzo Venturino I Why Italian football needs to watch out for Roma starlet

Serie A giants Roma roped in Lorenzo Venturino from Genoa in January in a deal that went rather under-the-radar even in Italy. The attacker joined on an initial loan, with the Giallorossi having an option to buy the player permanently. The youngster is 19 and despite not having played much at Genoa in the first

Rates on 30-year mortgages jumped last week.

Battered by stock losses, investors find little relief in bonds

The worst rout in Treasurys since April’s tariff chaos is exacerbating strain in financial markets, a stark demonstration of how war’s disruptions to oil flows are leaving investors with few places to shelter. Rates on 30-year mortgages jumped last week. The Hormuz blockade has spurred one of the largest oil shocks on record, raising fears

ET logo

Worries about global economic pain deepen as the war in Iran drags on

Washington: U.S. and Israeli attacks on Iran have driven up prices, darkened the outlook for the world economy, sent global stock markets reeling and forced developing countries to ration fuel and subsidize energy costs to protect their poorest. Ongoing strikes and counterstrikes on Persian Gulf refineries, pipelines, gas fields and tanker terminals threaten to the

People queue to have OpenClaw installed on their laptops at Baidu headquarters in Beijing on March 11, 2026.

OpenClaw: China’s latest tech obsession could be a game changer

Taipei / Beijing —  At China’s hot new tech events, lobsters are everywhere –– lobster balloons, lobster headbands, lobster plushies in claw machines, even live lobsters in an inflatable kiddie pool. But the attendees swarming the meet-ups are not here for the crustaceans –– they’re here for the new technology they represent: OpenClaw, an autonomous artificial

The Curse of Oak Island Season 13 Episode 20 Release Date, Time, Where to Watch

The Curse of Oak Island Season 13 Episode 20 release date and time are right around the corner, and many want to know the streaming details. In the previous episode, the team made stunning discoveries on Lot 8 and in the Money Pit area. New research showcases a potential connection between the Oak Island mystery

Donald Trump reacts to ‘very close friend’ Tiger Woods’ DUI arrest

Donald Trump has reacted to the DUI arrest of his friend Tiger Woods.The golf legend was arrested following a car crash near his Florida home on Friday afternoon. “I feel so badly. He’s got some difficulties,” Trump shared with media gathered on the tarmac at an airport in Miami. Advertisement “There was an accident, that’s

Hong Kong passengers caught off guard by new airport limit of 2 power banks

Hong Kong passengers caught off guard by new airport limit of 2 power banks

Air passengers departing from Hong Kong have said they were unaware of a new rule limiting the number of power banks they could carry to two, with few reminder signs visible at the airport on the first day of its enforcement on Sunday. Hong Kong International Airport announced on Saturday night that departing passengers were

‘Allegri is a master, our goal is to qualify for the Champions League’

MILAN, ITALY – AUGUST 17: Ardon Jashari of AC Milan in action during the Coppa Italia match between AC Milan and SSC Bari at Stadio San Siro on August 17, 2025 in Milan, Italy. (Photo by Marco Luzzani/Getty Images) Ardon Jashari has opened up on his settling-in period at Milan since arriving from Club

Here’s ARK Innovation ETF’s Vision for the Future. Do You Agree With It?

With many exchange-traded funds, all an investor needs to believe is that the stock market will continue to rise. With more than a century of stock market history supporting that idea, that’s not a big ask. But when you move into the realm of actively managed ETFs, you have to believe in the vision that

logo

China Urges Philippines To Stabilize Ties Amid Maritime Row

By Bloomberg News Mar 28, 2026 (Bloomberg) –China called on the Philippines to help create the conditions needed to stabilize and improve bilateral relations as officials concluded two days of talks on their territorial disputes in the South China Sea. Officials held a “candid and in-depth” exchange of views on relations, and international and regional issues,

Unihertz Titan 2 Elite: Premium physical keyboard phone

Shanghai-based Unihertz has made a name for itself in recent years with its varied lineup of rugged phones, tiny phones, and BlackBerry-style handsets with full physical keyboards. The brand’s latest offering is a more premium phone for typing enthusiasts. The Titan 2 Elite features a pleasing design with rounded corners, and plenty of upgrades inside

Celebrity bartending for a good cause

Rochester, N.Y. — The Old Toad held a celebrity bartending event Saturday with 13WHAM’s own Scott Hesko helping raise funds for the American Heart Association. The event recognizes Jennifer Hetsko, who was named one of four “women of impact” by the group. Jennifer adds that heart health and cardiovascular disease are the number one killers

Pictured is Krispy Kreme's limited-edition Artemis II Doughnut.

Krispy Kreme’s Artemis II Doughnut is ready for liftoff. See new item.

In five, four, three, two, one, Krispy Kreme is launching a limited-edition Artemis II Doughnut just in time to celebrate NASA’s “historic moment in space exploration.” Ahead of the planned launch of Artemis II on April 1, the Charlotte, North Carolina-headquartered chain announced the debut of the specialty doughnut, available March 31 through April 2

Supreme FC

Supreme FC – South China, 29/03/2026 – Hong Kong FA Cup Junior Division – Match sheet

Supreme FC – South China, 29/03/2026 – Hong Kong FA Cup Junior Division – Match sheet | Transfermarkt DISCOVER TRANSFERS & RUMOURS MARKET VALUES COMPETITIONS STATISTICS FORUM GAMING Recommendations Player agents Player agents Overall balance Draws 1 Top fixture-goal scorers Player Club Goals 2 2 1 1 Transfers between each other These players were transferred

0
Would love your thoughts, please comment.x
()
x