const [state, setState] = useState("");
<input onChange={e=>setState(e.target.value)}
I know that I can use onChange={} to get each value but I want to get the
(shirts x pants x shoes) when a button onClick={} event happens
function Somethingie() {
return (
<div>
Shirts: <input className="one" type="number"></input>
Pants: <input className="two" type="number"></input>
Shoes: <input className="three" type="number"></input>
<br /> <br />
<button
onClick={() => {
console.log(
document.querySelector(".one").value *
document.querySelector(".two").value *
document.querySelector(".three").value
);
}}
>
Calculate!
</button>
<br /> <br />
Amount of Possible Outfits: <h1 className="result"></h1>
</div>
);
}
ReactDOM.render(
<Somethingie />,
document.getElementById("root")
);
or do I create an async function?
I would create a state for each input, set the value of the respective input to this state, set the state for each input onChange, and finally, in the onClick of the button just combine the three states.
Example input:
const [state1, setState1] = useState("")
...
const change1 = (e) => {
setState1(e.target.value);
}
...
<input className="one" type="number" value={state1} onChange={change1}/>
onClick of the button
const handleClick = () => {
result = state1 * state2 * state3;
}
function Somethingie() {
return (
<div>
Shirts: <input className="one" type="number"></input>
Pants: <input className="two" type="number"></input>
Shoes: <input className="three" type="number"></input>
<br /> <br />
<button
onClick={() => {
let x = document.getElementsByClassName('result');
x[0].innerHTML =
document.querySelector('.one').value *
document.querySelector('.two').value *
document.querySelector('.three').value;
}}
>
Calculate!
</button>
<br /> <br />
Amount of Possible Outfits: <h1 className="result"></h1>
</div>
);}
ReactDOM.render(
<Somethingie />,
document.getElementById("root")
);
You can directly place calculated value as shown in above code snippet.
You need to keep each of the data in its own useState like this:
import { useState } from "react";
const Combinations = () => {
const [shirts, setShirts] = useState(0);
const [pants, setPants] = useState(0);
const [shoes, setShoes] = useState(0);
const [total, setTotal] = useState(0);
const onChange = (e) => {
console.log(e);
console.log(typeof e.target.value);
console.log(Number(e.target.value));
if (e.target.name === "shirts") setShirts(Number(e.target.value));
if (e.target.name === "pants") setPants(Number(e.target.value));
if (e.target.name === "shoes") setShoes(Number(e.target.value));
};
const calculate = () => {
let all = null;
if (shirts !== 0) {
if (all === null) {
all = shirts;
} else {
all *= shirts;
}
}
if (pants !== 0) {
if (all === null) {
all = pants;
} else {
all *= pants;
}
}
if (shoes !== 0) {
if (all === null) {
all = shoes;
} else {
all *= shoes;
}
}
setTotal(all);
};
return (
<div>
<label htmlFor="shirts">Shirts: </label>
<input
type="number"
id="shirts"
name="shirts"
value={shirts}
onChange={onChange}
/>
<br />
<label htmlFor="pants">Pants: </label>
<input
type="number"
id="pants"
name="pants"
value={pants}
onChange={onChange}
/>
<br />
<label htmlFor="shoes">Shoes: </label>
<input
type="number"
id="shoes"
name="shoes"
value={shoes}
onChange={onChange}
/>
<br />
<button onClick={calculate}>Calculate!</button>
<br />
<p>Amount of Possible Outfits: {total}</p>
</div>
);
}
Related
how can I force only one check among multiple checkboxes ? For now I can select A, B and C but I only want to select ONE choice no more.
Here is my code :
const TabContent = ({ name, typeText }) => {
const [a, setA] = useState(false)
const [b, setB] = useState(false)
const [c, setC] = useState(false)
function handleChange(e) {
e.preventDefault()
}
return (
<form onSubmit={handleChange} >
{a}
{b}
{b}
<input type="checkbox" onChange={(e) => setA(!a)} /> <label> A </label>
<input type="checkbox" onChange={(e) => setB(!b)} /> <label>B</label>
<input type="checkbox" onChange={(e) => setC(!C)} /> <label>C</label>
</form>
{
(a || b) ?
(<div>
<p className="mt-6 py-1">My choices </p>
<SafeAreaView>
<TextInput
onChangeText={(value) => setText(value)}
value={text}
/>
</SafeAreaView>
</div >
)
: ('')
}
{
c?
(...)
}
</div >
);
};
I think you want to use radio input
Example to illustrate this:
https://codesandbox.io/s/elegant-tess-wu7sl7?file=/src/App.js:0-794
import React, { useState } from "react";
export const TabContent = ({ name, typeText }) => {
const [radio, setRadio] = useState(false);
function handleChange(e) {
e.preventDefault();
}
return (
<form onSubmit={handleChange}>
<input
type="radio"
value="A"
onChange={(e) => setRadio(e.target.value)}
checked={radio === "A"}
/>
<label> A </label>
<input
type="radio"
value="B"
checked={radio === "B"}
onChange={(e) => setRadio(e.target.value)}
/>
<label>B</label>
<input
type="radio"
value="C"
checked={radio === "C"}
onChange={(e) => setRadio(e.target.value)}
/>
<label>C</label>
</form>
);
};
export default TabContent;
This way you only keep track of one state.
You can refactor your state with object state instead of using 3 states
const TabContent = ({ name, typeText }) => {
const [check, setCheck] = useState({selected: "", checked: false})
const handleCheckbox = (type) => {
if(type === check.selected && check.checked) {
setCheck({...check, checked: false})
} else {
setCheck({selected: type, checked: true})
}
}
function handleChange(e) {
e.preventDefault()
}
return (
<form onSubmit={handleChange} >
{check.selected}
<input type="checkbox" onChange={(e) => handleCheckbox("a")} /> <label> A </label>
<input type="checkbox" onChange={(e) => handleCheckbox("b")} /> <label>B</label>
<input type="checkbox" onChange={(e) => handleCheckbox("c")} /> <label>C</label>
</form>
{
(check.selected === ("a" || "b")) ?
(<div>
<p className="mt-6 py-1">My choices </p>
<SafeAreaView>
<TextInput
onChangeText={(value) => setText(value)}
value={text}
/>
</SafeAreaView>
</div >
)
: ('')
}
{
(check.selected === "c") ?
(...)
}
</div >
);
};
I have the following code in my react app and I need to have empty input areas after submitting. Please assist me.
import { useRef } from 'react';
import './Contact.css';
import emailjs from 'emailjs-com'
import { useState, useEffect } from 'react';
const Contact = () => {
const formRef = useRef();
const [done, setDone] = useState(false);
const handleSubmit = (e) => {
e.preventDefault();
emailjs.sendForm(
'service_py6v3mm',
'template_db5q8nx',
formRef.current,
'mJDC1if10C25Z-TZC'
)
.then((result) => {
console.log(result.text);
setDone(true);
}, (error) => {
console.log(error.text);
});
}
return (
<div className="c">
<div className='c-wrapper'>
<div className='c-left'>
<h1 className='c-title'> Let's discuss!</h1>
<div className='c-info'>
<div className='c-info-item'>
<div className="c-info-item">
<img
src="./images/Phone.jpg"
alt=""
className="c-icon"
/>
+12345678 </div>
<div className="c-info-item">
<img className='c-icon'
src="./images/Email.png" alt='Email' />
messimacky#gmail.com
</div>
<div className="c-info-item">
<img className='c-icon'
src="./images/Location.jpeg"
alt=" " />
Addis Ababa, Wolo Sefer, Ethio-China Road, Ethiopia
</div>
</div>
</div>
</div>
<div className='c-right'>
<p className='c-desc'> <b> Get in touch!</b>
</p>
<form ref={formRef} onSubmit={handleSubmit}>
<input type='text' placeholder='Name' name='username' />
<input type='text' placeholder='Subject' name='user_subject' />
<input type='text' placeholder='Your email here... ' name='user_email' />
<textarea rows={5} placeholder='message' name='message' /> <br />
<button>Submit</button>
{done && <p> Thank you I will contact you soon!</p>}
</form>
</div>
</div>
</div>
)
}
export default Contact
You can bind every input value to a state and empty them when you submit it. Here I add an example for the username. You can multiply it and use it.
const [username, setUsername] = useState('Name');
const submitFunctionWhichDeletes = () => {
console.log(username);
setUsername('');
}
<input ... value={username} onChange={e => setUsername(e.target.value)} ... />
const compForm = ()=>{
const [formData,addFormData] = useState({
username:"",
subject:"",
email:"",
message:""
})
cosnt formSubmit =()=>{
// make api call
addFormData({
username:"",
subject:"",
email:"",
message:""
})
}
const formData = (e,filed)=>{
const temp = {...formData}
if (filed === "username"){
temp.username = e.target.value
}
else if(filed === "subject"){
temp.subject = e.target.value
}
else if(filed === "email"){
temp.email = e.target.value
}
else if(filed === "message"){
temp.message = e.target.value
}
addFormData(temp)
}
return(
<>
<input type='text' placeholder='Name' name='username'
value={formData.username} onChange={(e)=>formData(e,username)}/>
<input type='text' placeholder='Subject' name='user_subject'
value={formData.subject} onChange={(e)=>formData(e,subject)}/>
<input type='text' placeholder='Your email here... ' name='user_email'
value={formData.email} onChange={(e)=>formData(e,email)}/>
<textarea rows={5} placeholder='message' name='message'
value={formData.message} onChange={(e)=>formData(e,message)}/>
<button onClick = {(e)=>formSubmit()}>Submit</button>
<>
)
}
I have following code of Calculator.jsx where everything looks fine.The main thing I want to achieve is keyboard to displayed only on input click which is done but the keyboard does not seem to type though the following code looks fine. Are there any other way to show/hide keyboard only on input click as well as make keyboard be able to type. My code for Calculator.jsx is
Calculator.jsx
import React, { useState, useRef, useEffect } from 'react';
import './Calculator.css'
import { Link } from 'react-router-dom';
import Keyboard from "react-simple-keyboard";
import "react-simple-keyboard/build/css/index.css";
const Calculator = () => {
const [inputs, setInputs] = useState({});
const [layoutName, setLayoutName] = useState("default");
const [inputName, setInputName] = useState("default");
const keyboard = useRef();
const [keyboardVisibility, setKeyboardVisibility] = useState(false);
useEffect(() => {
function clickHanlder(e) {
if (
!(e.target.nodeName === "INPUT") &&
!e.target.classList.contains("hg-button") &&
!e.target.classList.contains("hg-row")
) {
setKeyboardVisibility(false);
}
}
window.addEventListener("click", clickHanlder);
return window.removeEventListener("click", clickHanlder, true);
}, []);
const onChangeAll = inputs => {
setInputs({ ...inputs });
console.log("Inputs changed", inputs);
};
const handleShift = () => {
const newLayoutName = layoutName === "default" ? "shift" : "default";
setLayoutName(newLayoutName);
};
const onKeyPress = button => {
console.log("Button pressed", button);
if (button === "{shift}" || button === "{lock}") handleShift();
};
const onChangeInput = event => {
const inputVal = event.target.value;
setInputs({
...inputs,
[inputName]: inputVal
});
keyboard.current.setInput(inputVal);
};
const getInputValue = inputName => {
return inputs[inputName] || "";
};
return (
<div>
<div className="bg">
<div className="deposit">
<div className="header">
<h1>Deposit Calculator</h1>
<div className="form">
<form className="calculator">
<div className="form-group">
<label for="depositAmount">Deposit Amount:</label>
<span className="rupees">Rs</span>
<input className="IInput"
type="text"
name='depositAmount'
placeholder='0'
value={getInputValue("depositAmount")}
onChange={onChangeInput}
onFocus={() => {
setKeyboardVisibility(true);
setInputName("depositAmount")
}}
/>
</div>
<div className="form-group">
<label for="interestRate">Interest Rate:</label>
<input className= "IIinput"
type="text"
name='Interest'
placeholder='0'
value={getInputValue("interestRate")}
onChange={onChangeInput}
onFocus={() => {
setKeyboardVisibility(true);
setInputName("interestRate")
}}
/>
<span className= "percent">%</span>
</div>
<div class="form-group">
<label for="Tenure">Tenure:</label>
<input className="Input"
type='number'
min='1'
max='5'
name='tenure'
placeholder='1 year'
value={getInputValue("tenure")}
onChange={onChangeInput}
onFocus={() => {
setKeyboardVisibility(true);
setInputName("tenure")
}}
/>
</div>
{ keyboardVisibility && (
<Keyboard
keyboardRef={(r) => (keyboard.current = r)}
layoutName={layoutName}
onChange={onChangeAll}
onKeyPress={onKeyPress}
/>
)}
</form>
<button className="calculate">Calculate
</button>
</div>
<div className="given">
<p >
Total Deposit: Rs 0
</p>
<p>
Interest: Rs 0
</p>
<p>
Maturity Amount: Rs 0
</p>
</div>
</div>
</div>
</div>
<Link to="/">
<button className="Back">
<i class="fas fa-angle-double-left"></i>
</button>
</Link>
</div>
);
};
export default Calculator;
You are setting the inputs state by spreading input string from keyboard onChangeAll into an object setInputs({ ...inputs }). If I enter ab it will set as {0: "a", 1:"b"}.
Update the onChange prop in Keyboard to onChangeAll and pass inputName prop with your inputName state value. Read react-simple-keyboard DOCS.
onChangeAll
const onChangeAll = (inputs) => {
console.log("Inputs changed", inputs);
setInputs(inputs);
};
Keyboard
{keyboardVisibility && (
<Keyboard
keyboardRef={(r) => (keyboard.current = r)}
layoutName={layoutName}
onChangeAll={onChangeAll}
onKeyPress={onKeyPress}
inputName={inputName}
/>
)}
CodeSandbox link
I have a form that uploads its values to the Firestore database, and would like to use the same component for updating the values, so the question might really be - how to load initial state according to a conditional whether the props are passed?
The form
import Servis from "./funkc/servisni";
import React, { useState } from "react";
export default function ContactUpdate(props) {
//
console.log(props.item);
//
const initialState = {
id: props.item.id,
ime: props.item.Ime,
prezime: props.item.Prezime,
imeError: "",
prezimeError: "",
date: props.item.Datum,
kontakt: props.item.Kontakt,
kontaktError: "",
published: true,
};
const [theItem, setTheItem] = useState(initialState);
const [imeError, setImeError] = useState();
const [prezimeError, setPrezimeError] = useState();
const [message, setMessage] = useState();
const { item } = props;
if (theItem.id !== item.id) {
setTheItem(item);
}
const handleInputChange = (event) => {
const { name, value } = event.target;
setTheItem({ ...theItem, [name]: value });
};
const updatePublished = (status) => {
Servis.update(theItem.id0, { published: status })
.then(() => {
setTheItem({ ...theItem, published: status });
setMessage("The status was updated successfully!");
})
.catch((e) => {
console.log(e);
});
};
const updateItem = () => {
let data = {
Ime: theItem.ime,
Prezime: theItem.prezime,
Kontakt: theItem.kontakt,
Datum: theItem.date,
published: true,
};
Servis.update(theItem.id, data)
.then(() => {
setMessage("The tutorial was updated successfully!");
})
.catch((e) => {
console.log(e);
});
};
const deleteItem = () => {
Servis.remove(theItem.id)
.then(() => {
props.refreshList();
})
.catch((e) => {
console.log(e);
});
};
const validate = () => {
let imeError = "";
let kontaktError = "";
if (!theItem.ime) {
imeError = "obavezan unos imena!";
}
if (!theItem.kontakt) {
imeError = "obavezan unos kontakta!";
}
if (kontaktError || imeError) {
this.setState({ kontaktError, imeError });
return false;
}
return true;
};
return (
<div className="container">
{theItem ? (
<div className="edit-form">
<h4>Kontakt</h4>
<form>
<div className="form-group">
<label htmlFor="ime">Ime</label>
<input
type="text"
className="form-control"
// id="title"
name="ime"
value={theItem.Ime}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label htmlFor="Prezime">Prezime</label>
<input
type="text"
className="form-control"
// id="description"
name="Prezime"
value={theItem.Prezime}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label htmlFor="Datum">Datum</label>
<input
type="text"
className="form-control"
// id="description"
name="Datum"
value={theItem.Datum}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label htmlFor="Kontakt">Kontakt</label>
<input
type="text"
className="form-control"
// id="description"
name="Kontakt"
value={theItem.Kontakt}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label>
<strong>Status:</strong>
</label>
{theItem.published ? "Published" : "Pending"}
</div>
</form>
{theItem.published ? (
<button onClick={() => updatePublished(false)}>UnPublish</button>
) : (
<button onClick={() => updatePublished(true)}>Publish</button>
)}
<button onClick={deleteItem}>Delete</button>
<button type="submit" onClick={updateItem}>
Update
</button>
<p>{message}</p>
</div>
) : (
<div>
<br />
<p>Please click on a Tutorial...</p>
</div>
)}{" "}
</div>
);
}
The component passing the props:
import React, { useState, useEffect } from "react";
import firebase from "./firebase";
import { Link } from "react-router-dom";
export default function FireDetail({ match }) {
console.log(match);
console.log(match.params.id);
const [item, setItem] = useState([]);
const [loading, setLoading] = useState();
const getIt = () => {
setLoading(true);
const docRef = firebase
.firestore()
.collection("polja")
.doc(match.params.id)
.get()
.then((doc) => {
setItem(doc.data());
});
//
console.log(docRef);
//
// const docRef = firebase.firestore().collection("polja").doc("documentId")
//
setLoading(false);
};
useEffect(() => {
getIt();
}, [match]);
if (loading) {
return <h3>samo malo...</h3>;
}
return (
<div className="container">
<div>
{console.log("item: ", item)}
Kontakt: tip - email
<p> {item.Kontakt}</p>
</div>
<div>
<p>Datum rodjenja: {item.Datum}</p>
{item.Prezime} {item.Ime}
</div>
<Link to={`/kontakt/update/${item.id}`}> ajd </Link>
</div>
);
}
Or you might have an alternative idea on how to solve the problem?
indeed it is
export default function ContactUpdate(props) {
const initialState = {
ime: props.item.Ime,
prezime: props.item.Prezime,
datum: props.item.Datum,
kontakt: props.item.Kontakt,
id: props.Id,
};
const [theItem, setTheItem] = useState();
const [message, setMessage] = useState();
useEffect(() => {
setTheItem(props.item);
}, []);
const handleInputChange = (event) => {
const { name, value } = event.target;
setTheItem({ ...theItem, [name]: value });
console.log(theItem);
};
const updateItem = (theItem) => {
let data = {
Ime: theItem.Ime,
Prezime: theItem.Prezime,
Kontakt: theItem.Kontakt,
Datum: theItem.Datum,
};
console.log(updateItem());
Servis.update(theItem.id, data)
.then(() => {
setMessage("Uspjesno ste izmijenili unos!");
})
.catch((e) => {
console.log(e);
});
};
const deleteItem = () => {
Servis.remove(theItem.id).catch((e) => {
console.log(e);
});
};
return (
<div className="container">
{console.log(("theItem", props, theItem))}
{theItem ? (
<div className="edit-form">
<h4>Kontakt</h4>
<form>
<div className="form-group">
<label htmlFor="ime">Ime</label>
<input
type="text"
className="form-control"
name="Ime"
value={theItem.Ime}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label htmlFor="prezime">Prezime</label>
<input
type="text"
className="form-control"
name="Prezime"
value={theItem.Prezime}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label htmlFor="datum">Datum</label>
<input
type="text"
className="form-control"
name="Datum"
value={theItem.Datum}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label htmlFor="kontakt">Kontakt</label>
<input
type="text"
className="form-control"
name="Kontakt"
value={theItem.Kontakt}
onChange={handleInputChange}
/>
</div>
<div className="form-group">
<label>
<strong>Status:</strong>
</label>
</div>
</form>
<button onClick={deleteItem}>Delete</button>
<button type="submit" onClick={updateItem}>
Update
</button>
<p>{message}</p>
</div>
) : (
<div>
<br />
<p>Odaberi jedan broj...</p>
</div>
)}{" "}
</div>
);
}
I am using react-hook-form in my project for form data handling.
I have a create functionality that has three modal screens, and I need the entire three modal screens data on the third-page submission. How can I get this?
I tried useFormContext but it's retrieving me the last third modal screen data instead of the entire data.
// Parent Component
const Parent = () => {
const [page, setPage] = useState(1);
const nextPage = () => setPage(page + 1);
const previousPage = () => setPage(page - 1);
const methods = useForm();
return (
<FormProvider {...methods}>
// after submitting 3 forms, I get 3rd form data here, below line
<form onSubmit={methods.handleSubmit(data => console.log(data))}>
{page === 1 && (
<CreateOne
nextPage={nextPage}
cancel={cancel}
/>
)}
{page === 2 && (
<CreateTwo
previousPage={previousPage}
nextPage={nextPage}
/>
)}
{page === 3 && (
<CreateThree
previousPage={previousPage}
cancel={cancel}
/>
)}
</form>
</FormProvider>
);
}
const CreateOne = ({ nextPage, cancel }) => {
const methods = useFormContext();
return (
<input ... ref={methods.register} />
<input ... ref={methods.register} />
<input ... ref={methods.register} />
<Button onClick={cancel} text="cancel" />
<Button type="submit" onClick={nextPage} text="next"/>
);
}
const CreateOTwo = ({previousPage, nextPage}) => {
const methods = useFormContext();
return (
<input ... ref={methods.register} />
<input ... ref={methods.register} />
<input ... ref={methods.register} />
<Button onClick={previousPage} text="previousPage" />
<Button type="submit" onClick={nextPage} text="next"/>
);
}
const CreateOThree = ({previousPage}) => {
const methods = useFormContext();
return (
<input ... ref={methods.register} />
<input ... ref={methods.register} />
<input ... ref={methods.register} />
<Button onClick={previousPage} text="previousPage" />
<Button type="submit" text="submit"/>
);
}
Can anyone help me with pointers? how can I get the 3 modal screens data?
I solved this... Posting the answer here, so it could help others..
// Parent Component
const Parent = () => {
const [page, setPage] = useState(1);
const nextPage = () => setPage(page + 1);
const previousPage = () => setPage(page - 1);
const [finalObj, setFinalObj] = useState(null);
useEffect(() => {
// this if, checks and then once 3rd form form data is available, we call parent fn.
if (page === 3) {
CallParentWhichTriggeredThisModal(vendor);
}
}, [page]); // this useEffect hook gets called for each page state change, as we passed
//this as the second array of parameters.
const page1= (data) => {
setFinalObj((prevState) => ({ ...prevState, ...data }));
nextPage();
};
const page2= (data) => {
setFinalObj((prevState) => ({ ...prevState, ...data}));
nextPage();
};
const page3= async (data) => {
// this setState below is an asynchronous, so if you call your parent fn, just below this, // then you might lose the 3rd page data. to fix this, we used useEffect.
setFinalObj((prevState) => ({ ...prevState, ...data}));
};
return (
<>
{page === 1 && (
<CreateOne
nextPage={nextPage}
cancel={cancel}
submitForm={page1}
/>
)}
{page === 2 && (
<CreateTwo
previousPage={previousPage}
nextPage={nextPage}
submitForm={page2}
/>
)}
{page === 3 && (
<CreateThree
previousPage={previousPage}
cancel={cancel}
submitForm={page3}
/>
)}
</>
);
}
const CreateOne = ({ submitForm, nextPage, cancel }) => {
const methods = useFormContext();
const { register, handleSubmit } = useForm();
return (
<form onSubmit={handleSubmit(submitForm)}>
<input ... ref={register} />
<input ... ref={register} />
<input ... ref={register} />
<Button onClick={cancel} text="cancel" />
<Button type="submit" text="next"/>
</form>
);
}
const CreateOTwo = ({submitForm, previousPage, nextPage}) => {
const methods = useFormContext();
const { register, handleSubmit } = useForm();
return (
<form onSubmit={handleSubmit(submitForm)}>
<input ... ref={register} />
<input ... ref={register} />
<input ... ref={register} />
<Button onClick={cancel} text="cancel" />
<Button type="submit" text="next"/>
</form>
);
}
const CreateOThree = ({submitForm, previousPage}) => {
const methods = useFormContext();
const { register, handleSubmit } = useForm();
return (
<form onSubmit={handleSubmit(submitForm)}>
<input ... ref={register} />
<input ... ref={register} />
<input ... ref={register} />
<Button onClick={cancel} text="cancel" />
<Button type="submit" text="next"/>
</form>
);
}