Skip to content
Snippets Groups Projects
Commit e159f1d8 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Add Aup checkbox to the form

parent 6d403b88
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ function Main(props) {
const [validated, setValidated] = useState(false);
const [modalTitle, setModalTitle] = useState("Your account request has been submitted.");
const [modalBody, setModalBody] = useState(<Spinner animation="border" variant="success" />);
const [aup, setAup] = useState(false);
// Setup refs for easy access
const socketRef = useRef(null);
......@@ -32,6 +33,9 @@ function Main(props) {
// Define functions
const hideModal = () => setIsLoading(false);
const showModal = () => setIsLoading(true);
const handleAup = (e) => {
setAup(!aup)
}
const handleSubmit = (e) => {
e.preventDefault();
......@@ -46,7 +50,8 @@ function Main(props) {
'username': username,
'firstName': firstName.current.value,
'lastName': lastName.current.value,
'reason': reason.current.value
'reason': reason.current.value,
'aup': aup
});
}
}
......@@ -124,8 +129,14 @@ function Main(props) {
<Form.Label>Reason</Form.Label>
<Form.Control ref={reason} type="text" placeholder="Reason" />
</Form.Group>
<Form.Group controlId="formAUP">
<Form.Check onClick={handleAup} type="checkbox" label="Agree to proceed" />
<Form.Control.Feedback type="invalid">
Required
</Form.Control.Feedback>
</Form.Group>
<Form.Group controlId="formReason">
<Button variant="success" type="submit">
<Button disabled={!aup} variant="success" type="submit">
Submit
</Button>
</Form.Group>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment