Commit d6f57876 authored by Ben Anderson's avatar Ben Anderson

Tweaked product form fields

parent 6dd744aa
...@@ -28,7 +28,7 @@ export default function ProductForm(props) { ...@@ -28,7 +28,7 @@ export default function ProductForm(props) {
if (form.upc.length < 3) { if (form.upc.length < 3) {
errs.push("UPC must be at least 3 characters"); errs.push("UPC must be at least 3 characters");
} }
if (form.prodName.length === 0) { if (form.productName.length === 0) {
errs.push("Please enter a product name"); errs.push("Please enter a product name");
} }
if (form.brand.length === 0) { if (form.brand.length === 0) {
...@@ -127,17 +127,17 @@ export default function ProductForm(props) { ...@@ -127,17 +127,17 @@ export default function ProductForm(props) {
<div className="row mt-3"> <div className="row mt-3">
<div className="col-6"> <div className="col-6">
<div> <div>
<label htmlFor="prodName" className="form-label"> <label htmlFor="productName" className="form-label">
Name Name
</label> </label>
<input <input
required required
name="prodName" name="productName"
type="text" type="text"
className="form-control" className="form-control"
id="prodName" id="productName"
value={form.prodName} value={form.productName}
onChange={(e) => setForm({ ...form, prodName: e.target.value })} onChange={(e) => setForm({ ...form, productName: e.target.value })}
/> />
</div> </div>
<div> <div>
...@@ -170,17 +170,17 @@ export default function ProductForm(props) { ...@@ -170,17 +170,17 @@ export default function ProductForm(props) {
</div> </div>
</div> </div>
<div className="col-6"> <div className="col-6">
<label htmlFor="prodDesc" className="form-label"> <label htmlFor="productDesc" className="form-label">
Description Description
</label> </label>
<textarea <textarea
name="prodDesc" name="productDesc"
id="prodDesc" id="productDesc"
cols="40" cols="40"
rows="7" rows="7"
className="form-control" className="form-control"
value={form.prodDesc} value={form.productDesc}
onChange={(e) => setForm({ ...form, prodDesc: e.target.value })} onChange={(e) => setForm({ ...form, productDesc: e.target.value })}
></textarea> ></textarea>
</div> </div>
</div> </div>
......
const emptyProduct = { const emptyProduct = {
sku: "", sku: "",
upc: "", upc: "",
prodName: "", productName: "",
brand: "", brand: "",
category: "", category: "",
price: 0.0, price: 0.0,
stock: 0, stock: 0,
prodDesc: "", productDesc: "",
prodImgUrl: "" prodImgUrl: ""
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment