55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
import { useState } from 'react';
|
|
import { Button, Form, Input } from 'react-bootstrap';
|
|
|
|
const Page3 = () => {
|
|
const someValue = 'Некоторое значение';
|
|
const [validated, setValidated] = useState(false);
|
|
const [formData, setFormData] = useState({
|
|
lastname: '',
|
|
firstname: '',
|
|
email: '',
|
|
password: '',
|
|
date: '',
|
|
disabled: someValue,
|
|
readonly: someValue,
|
|
color: '#ff0055',
|
|
checkbox1: false,
|
|
checkbox2: false,
|
|
radio1: false,
|
|
radio2: false,
|
|
selected: '',
|
|
});
|
|
|
|
const handleSubmit = (event) => {
|
|
const form = event.currentTarget;
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
if (form.checkValidity() !== false) {
|
|
console.log(formData);
|
|
}
|
|
setValidated(true);
|
|
};
|
|
|
|
const handleChange = (event) => {
|
|
const inputName = event.target.name;
|
|
const inputValue = event.target.type === 'checkbox' ? event.target.checked : event.target.value;
|
|
setFormData({
|
|
...formData,
|
|
[inputName]: inputValue,
|
|
});
|
|
};
|
|
|
|
return (
|
|
<div className='row justify-content-center'>
|
|
<Input className = "justify-content-md-center w-50"
|
|
value = 'sxasc'
|
|
type="search"
|
|
id="direction"
|
|
name="direction"
|
|
required></Input>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Page3;
|