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

Lucky Coffee and Espresso Introduces the Cleanest Cup of Coffee

Image: https://www.abnewswire.com/upload/2025/04/5ae10a05962ca0c53cdedb9a8d3fa483.jpg Royal Oak, MI – Health-conscious coffee lovers, rejoice! Lucky Detroit Coffee and Espresso Coffee Shop [https://www.luckydetroit.com/pages/royal-oak-coffee-shop-coffee-roasters] is redefining your daily brew by offering a clean, eco-conscious, and flavor-rich coffee experience. Known for their commitment to quality and sustainability, Lucky Coffee and Espresso caters to health-conscious consumers, eco-friendly individuals, and coffee enthusiasts seeking a

Cool Things We Discovered at the Amsterdam Coffee Fest

On the first weekend of April, Amsterdam hosted the 10th edition of its coffee festival. Today, we’re sharing a few interesting things we saw at the event. BY TANYA NANETTISENIOR ONLINE CORRESPONDENT Photos by Tanya Nanetti On an unexpectedly warm and sunny weekend in early April, Amsterdam hosted the 10th annual Amsterdam Coffee Festival. One

Single-Serve Pod Coffee Machine Market Size, Share,

LPI (LP Information) released the report titled “Global Single-Serve Pod Coffee Machine Market Growth (Status and Outlook) 2025-2031.” This report provides a comprehensive analysis of the global Single-Serve Pod Coffee Machine landscape, with a focus on key trends related to product segmentation, company establishment, revenue and market share, recent developments, and merger and acquisition activities.

Moccamaster Cup-One review: The champ of hands-free coffee

I flip-flop between coffee brewing methods depending on my mood. Sometimes I’ve got enough energy to craft artisanal experimental beverages on my espresso machine, sometimes I love perfecting my skills with iconic pour-overs, and sometimes I just want to flip a switch and be done. So, for those days, there’s nothing better than the Moccamaster

Café Owners Rebuild After the L.A. Wildfires: Part Two

As the dust from January’s blaze begins to settle, what’s next? Los Angeles coffee shops share how they’re coping post-disaster. BY MELINA DEVONEYBARISTA MAGAZINE ONLINE Featured photo courtesy of Highlight Coffee Yesterday, we released part one of this article and heard from three cafés —Highlight Coffee, Caffe Luxxe, and Bevel Coffee—on how they were affected

Coffee Beats Bottled Water as Top Purchased BeverageDaily Coffee News by Roast Magazine

Two-thirds of United States adults who drank something other than tap water within the past day drank coffee, according to the latest biannual coffee market report from the U.S. National Coffee Association (NCA). According to the NCA’s National Coffee Data Trends report (NCDT), the 66% mark surpasses bottled water (64%), tea (44%), soda (43%), and

Bruvi BV-01 Review: Biodegradable Pods, Fast Coffee

The machine works quickly. It takes five seconds to heat water and brews cups back-to-back in about one minute per cup. After spending many a Christmas morning groggily standing at my mom’s Keurig waiting for it to heat up so we can all get our coffee fix, the ability to brew cups in quick succession

Café Owners Rebuild After the L.A. Wildfires: Part One

In January, flames burned through more than 55,000 acres of Los Angeles—the costliest blaze in U.S. history. Post-disaster, the city’s coffee shops are still healing. BY MELINA DEVONEYBARISTA MAGAZINE ONLINE Featured photo by Max Kukurudziak From January 7 to January 31, 2025, an onslaught of wildfires charred a large portion of Los Angeles, with most

Ready To Drink Tea And Coffee Market Expected To Reach USD 203.61

Ready To Drink Tea And Coffee Market The Ready To Drink Tea And Coffee Market is expected to reach US$ 203.61 Bn. by 2029, at a CAGR of 7.52% during the forecast period. Ready To Drink Tea And Coffee Market Overview: The RTD tea and coffee sector has transformed from a niche category into a

Pete and Maria Licata Offer a New Approach to Caffeine Intake

After experiencing the negative effects of high caffeine intake, Pete and Maria Licata sought to create a solution. Cue their latest venture: Caffeine Control. BY VASILEIA FANARIOTISENIOR ONLINE CORRESPONDENT Photos courtesy of Pete Licata When 2013 World Barista Champion Pete Licata began feeling the persistent effects of burnout—restless sleep, midday crashes, and a creeping sense

Reverb Church permitted for Refuel Coffee shop in St. Augustine

Reverb Church wants to lift spirits in more ways than one. St. Johns County issued a build-out permit April 10 for the St. Augustine church to construct Refuel Coffee Co. at a cost of $400,000. Bryan Lamoureux The 2,359-square-foot store is planned at 35 Summerlin Lane, Suite 108, off U.S. 1 about two miles north

Latest global coffee and hospitality industry news

The bubble tea chain has introduced three coffee beverages to its Australian menu as part of strategy to attract more 35–44-year-olds to its 170 outlets Chatime operates 170 outlets across Australia | Photo credit: William Navarro   Chatime has introduced coffee to its menu in Australia for the first time in a bid to attract older millennial

Get Your Coffee Kicks on Route 66

10 of the best coffee roasters along America’s most famous highway Nearly 100 years ago, before the U.S. Interstate Highway system was born, Route 66 was established as a major transportation artery for both leisure travel and commercial transit. The route spanned 2,448 miles and meandered through eight states: Illinois, Missouri, Kansas, Oklahoma, Texas, New

5 Cool Cafés to Visit in Sacramento, California

Fondly known as the City of Trees, Sacramento is home to a quickly expanding specialty-coffee scene. BY EMILY JOY MENESESONLINE EDITOR Photos by Emily Joy Meneses As someone who was born and raised in California, one thing I’ve always wondered about Sacramento, Calif., is why, though it’s our state’s capital, the city tends to be

Discover Electric Pepper & Portable Coffee Grinders at Canton

The 137th Canton Fair, a global trade event, will be held in Guangzhou soon, attracting industry elites from more than 200 countries and regions. As a professional kitchenware manufacturer [https://www.chinagama.com/factory-tour/], Chinagama will showcase its newly developed Portable Electric Coffee Grinder [https://www.chinagama.com/electric-coffee-grinders/] and Electric Salt & Pepper Grinder Set [https://www.chinagama.com/custom-wireless-rechargeable-electric-salt-and-pepper-shaker-set-product/]at Booth 5.2K07-08, inviting buyers from all

Cometeer Introduces Proud Mary as its Latest Flash-Frozen Coffee Partner

GLOUCESTER, Mass., April 14, 2025 /PRNewswire/ — Cometeer, the innovator behind freshly brewed, flash-frozen coffee that delivers premium-quality coffee in a convenient, time-saving format, announces today a new partnership with Proud Mary, a celebrated Australia– and United States-based high-end coffee roaster. This collaboration will feature three of Proud Mary’s coffees, now available in Cometeer’s convenient,

Coffee shop owner with Down syndrome employs others with special needs

Nektario Tsinonis hasn’t let Down syndrome stop him from accomplishing his dreams. The Maryland native is now CEO of his very own coffee shop, and he’s building his business by employing others with special needs. With the help and support of his family, Nektario runs Beans & Dreams – Nektario’s Place, a coffee shop in

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