Skip to content
Junior–Senior163 views

Getting values from controlled and uncontrolled input fields

Task condition

It is necessary to implement a mechanism for reading data from controlled and uncontrolled input elements.

import React from "react";

export default function App() {
    const handleSubmit = () => {
        console.log("controlled input value: ");
        console.log("uncontrolled input value: ");
    };

    return (
        <form onClick={handleSubmit}>x
            <input
                placeholder="controlled field"
            />
            <input placeholder="uncontrolled field" />
            <button>Submit a credit application</button>
        </form>
    );
}
Frontend tasks in the code trainer