SShortSingh.
Back to feed

Repeated checkbox values lost when building query strings with Object.fromEntries

0
·4 views

A common JavaScript shortcut, Object.fromEntries(new FormData(form)), can silently drop values when a form sends several entries under the same key. For example, checking both Workshop and Talk may produce only one format value because plain objects cannot hold duplicate keys. The article's example, a static HTML file, compares correct serialization with the lossy object approach. It recommends using URLSearchParams and getAll() to preserve every value, and passing the submitter to FormData so the clicked button is included. The author also advises keeping personal information out of URLs and reserving this pattern for text-only GET filters rather than file uploads.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Measuring Before Changing: A Guide to Auditing CSS Performance

A short stylesheet can still slow a page, so the real test is whether it delays or disrupts what users experience. The guide recommends a measurement-first audit, starting with a clear description of the symptom, such as a slow first view, layout shifts, or unresponsive scrolling. It suggests recording baselines in browser tools like Chrome DevTools' Performance and Network panels and Lighthouse, while keeping test conditions consistent between runs. It also explains that unused CSS flagged in a single recording is only a candidate for review, since rules may apply on other routes or after interactions. Finally, it cautions that splitting stylesheets into many small files does not automatically improve speed.

0
ProgrammingDEV Community ·

Slow requests can stem from a full connection pool, not a slow database

A full service-side connection pool can look exactly like a slow database, since requests wait for a free connection before any query runs. Traces alone cannot reveal this, so the article points to OpenTelemetry connection-pool metrics such as connections in use, pool ceiling, and requests pending. The Ritele tool maps each pool to the database it reaches and totals usage across callers for a shared database. Each service gets a DB pool use health check that turns Degraded at 85% pool usage and Unhealthy at 98% with requests waiting. Pool pressure never marks the database itself as degraded or unhealthy.

0
ProgrammingDEV Community ·

56-Year-Old Non-Programmer Builds Apps Using Vibe Coding Tools

Faisal Khan, a 56-year-old with a technology background in business rather than software programming, describes how he taught himself to build apps. After failed attempts in 2025, he began to succeed in January 2026 by learning how to prompt AI coding tools such as Lovable, Replit, and Cursor. He also picked up supporting infrastructure like PostgreSQL, GitHub, Netlify, Vercel, and Neon along the way. By mid-2026 he was building small online businesses, and he says the experience has left him amazed at how quickly the tools have advanced.

0
ProgrammingDEV Community ·

Former IT Veteran Builds Free YouTube Shorts Library Explaining AI Concepts

A software engineer with nearly 40 years of experience is creating a free educational video library on Artificial Intelligence and Machine Learning. The project uses YouTube Shorts, with each video explaining a single technical concept in roughly 35 seconds. The creator says AI terminology is expanding faster than developers can keep up with, from Large Language Models to Retrieval-Augmented Generation and AI Agents. The goal is to explain what each technology is, how it works at a basic level, and why developers should care. The series is meant to help developers grasp the individual components that make up larger AI systems.