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

Iran war puts listings on hold

The National Stock Exchange (NSE) building in Mumbai, India, on Wednesday, Dec. 10, 2025. Dhiraj Singh | Bloomberg | Getty Images Global volatility is threatening a pipeline of multibillion-dollar stock market listings in India, the world’s busiest IPO market. Payments app PhonePe’s move on Monday to halt its listing plans has underscored a growing strain

‘Sports and entertainment combine to boost economy’

Representatives from the sports sector are optimistic about Hong Kong’s growing sports scene, with many highlighting the potential of combining athletics with entertainment to boost the city’s global image and economic vitality. Kenneth Fok, vice-president of the Sports Federation and Olympic Committee of Hong Kong, China, expressed hope for a stronger event economy, especially with

Latest and Breaking News on NDTV

Arrested US Mercenary Matthew VanDyke Explains How He Recruits Warfighters

New Delhi: American national Matthew Aaron VanDyke, who is in Indian custody and faces charges of illegally entering India to go to Myanmar for training ethnic insurgents, has left behind a large digital footprint going back over a decade. In one of them, he explained how he recruited “fighters” to be sent to wars across

Chinese Founder of router-maker TP-Link to Federal agencies: Our CEO and his wife are becoming US citizens under Trump Gold Card program

Chinese Founder of router-maker TP-Link to Federal agencies: Our CEO and his wife are becoming US citizens under Trump Gold Card program

Amid rising scrutiny, TP-Link’s CEO Jeffrey Chao is applying for U.S. permanent residency via a $1 million visa program, a move that coincides with ongoing federal investigations into his firm. The investigations, conducted by the Commerce, Justice, and FTC departments, are fueled by worries that Chinese authorities might pressure TP-Link to support cyber threats. Jeffrey

Exclusive: Barcelona determine their jersey for retro matchday in La Liga

La Liga is preparing to roll out something never seen before in Spanish football, a full-scale retro-themed matchday that taps into nostalgia and club identity. Across the weekend of April 10 to 13, clubs from both the first and second divisions will step onto the pitch wearing kits inspired by iconic designs from their past,

Neurodiverse workers could thrive in AI economy, says CareLineLive founder

Neurodiverse workers could hold a distinct advantage as artificial intelligence reshapes the modern workplace, according to a UK technology entrepreneur who says businesses are overlooking a critical talent pool at a pivotal moment of change. Josh Hough, founder of home care software firm CareLineLive, has argued that traits commonly associated with neurodiversity, including heightened focus,

supermicro headquarters

Supermicro executives charged in $2.5B AI smuggling scheme to China

NEWYou can now listen to Fox News articles! Federal prosecutors charged three men linked to Super Micro Computer Inc. in a sweeping scheme to smuggle billions of dollars in U.S. artificial intelligence technology to China using fake documents, shell companies and staged equipment, officials said. The defendants allegedly diverted $2.5 billion worth of AI servers

Donald Trump looking serious and sitting at a desk.

Trump has postponed his meeting with Xi, but China is not wasting any time on it

For months behind the scenes in Beijing, Chinese and American officials have been locked in negotiations over one of the most consequential political meetings of this year.  China’s President Xi Jinping was set to host United States President Donald Trump at a highly choreographed reception in Beijing at the end of March. Iran war live

Hong Kong crane collapse signals need for metal fatigue testing: expert

Hong Kong crane collapse signals need for metal fatigue testing: expert

Hong Kong should review its crane safety guidelines to include mandatory testing for metal fatigue, an industry expert has said after the city recorded another fatal case involving a collapse. An operator was killed on Thursday afternoon when a tower crane fell at a construction site for the second phase of a public housing project

ET logo

Gold and silver prices falling today: Why gold and silver prices are crashing despite US–Iran war and stock market turbulence, with gold now below $4,700 and silver falling under $70

Gold and silver prices have taken a sharp hit, with gold plunging to $4,691.70 per ounce (-4.18%) and silver sliding to $70.68 (-8.91%), marking their lowest levels in nearly a month. This sudden drop comes even as the US–Iran war intensifies and global markets face volatility—conditions that typically push precious metals higher. Instead, gold and

5 jailed, 20 more arrested in Hong Kong crackdown on illegal employment

5 jailed, 20 more arrested in Hong Kong crackdown on illegal employment

Five people have been jailed and another 20 arrested as part of a Hong Kong Immigration Department crackdown on illegal employment this week. The department said on Friday that it had raided 23 locations, including restaurants, cleaning companies and commercial buildings, as part of an operation that ran from Monday to Thursday. Those arrested comprised

An Army carry team moves the flag-draped transfer case containing the remains of U.S. Army soldier Maj. Sorffly Davius, of Cambria Heights, N.Y., who died in Kuwait, during a casualty return, Monday, March 9, 2026, at Dover Air Force Base, Del. (AP Photo/Julia Demaree Nikhinson)

Iran Retaliates Against Gulf Energy Sites as Stocks Sink Worldwide

The Iran war persisted Friday in drawing Arab neighbors directly into the conflict, with heavy explosions shaking Dubai early in the morning as air defenses intercepted incoming fire over the city as people observed Eid al-Fitr, the end of the holy Muslim fasting month of Ramadan. Bahrain’s Interior Ministry reported a fire erupted Friday morning

Starfighter for a Day & Ryan Gosling Regrets It

Ryan Gosling recently shared an unexpected behind-the-scenes moment from his experience on a Star Wars set. While discussing the production, he revealed a surprising detail involving Tom Cruise that quickly drew attention. Ryan Gosling was absent when Tom Cruise showed up on Star Wars movie set According to the Happy Sad Confused podcast interview with

U.S. Mint can begin to produce Trump commemorative gold coin : NPR

A federal arts commission on Thursday approved the final design for a 24-karat gold commemorative coin bearing President Donald Trump’s image to help celebrate America’s 250th birthday on July 4. Alex Brandon/AP hide caption toggle caption Alex Brandon/AP WASHINGTON — A federal arts commission on Thursday approved the final design for a 24-karat gold commemorative

John Tsang, former Hong Kong SAR Financial Secretary, introduced the patented disruptive innovation for functional sports apparel of Hong Kong SAR health-tech startup Comfiknit at the MIT Sports Summit, hosted by his alma mater, MIT, in the US.

Hong Kong Startup Comfiknit Shares Breakthrough Technology at the MIT Sports Summit

Subverting the Concept of “Fast-Drying” and Redefining Sports Functional Clothing HONG KONG, March 20, 2026 /PRNewswire/ — Eczewear‘s parent company, Comfiknit, a Hong Kong SAR-based health tech company developing sweat-management functional fabrics, introduced its sweat-wicking and cooling smart fabric technology that disrupts the concept of traditional “quick-drying” sportswear at the Sports Summit at the Massachusetts

The UK-based hiring platform was built to help candidates stand out.

Why our hiring platform Vizzy flips the CV on its head

Vizzy founders say the UK-based hiring platform was built to help candidates stand out. Many entrepreneurs attest to starting their businesses from the kitchen table. For the founders of Vizzy, the UK-based hiring platform that is reimagining the traditional CV, it was a case of mulling their idea over drinks in a greenhouse during COVID.

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