Problems

Serialize Form Data

MediumForms & Controlled Components

Build the submit payload. Input: line 1 — form state JSON; line 2 — JSON array of fields to include (in order). Print field=value pairs joined by & (URL-encode values with encodeURIComponent).

Input: two lines. Output: the query string.

Your program reads from stdin and prints to stdout.

Example 1

Input: {"name":"Ada Lovelace","role":"eng","secret":"x"} ["name","role"]

Output: name=Ada%20Lovelace&role=eng

Hints

ReactFormsSubmission
Serialize Form Data | CodeForge AI