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) {
if (form.upc.length < 3) {
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");
}
if (form.brand.length === 0) {
......@@ -127,17 +127,17 @@ export default function ProductForm(props) {
<div className="row mt-3">
<div className="col-6">
<div>
<label htmlFor="prodName" className="form-label">
<label htmlFor="productName" className="form-label">
Name
</label>
<input
required
name="prodName"
name="productName"
type="text"
className="form-control"
id="prodName"
value={form.prodName}
onChange={(e) => setForm({ ...form, prodName: e.target.value })}
id="productName"
value={form.productName}
onChange={(e) => setForm({ ...form, productName: e.target.value })}
/>
</div>
<div>
......@@ -170,17 +170,17 @@ export default function ProductForm(props) {
</div>
</div>
<div className="col-6">
<label htmlFor="prodDesc" className="form-label">
<label htmlFor="productDesc" className="form-label">
Description
</label>
<textarea
name="prodDesc"
id="prodDesc"
name="productDesc"
id="productDesc"
cols="40"
rows="7"
className="form-control"
value={form.prodDesc}
onChange={(e) => setForm({ ...form, prodDesc: e.target.value })}
value={form.productDesc}
onChange={(e) => setForm({ ...form, productDesc: e.target.value })}
></textarea>
</div>
</div>
......
const emptyProduct = {
sku: "",
upc: "",
prodName: "",
productName: "",
brand: "",
category: "",
price: 0.0,
stock: 0,
prodDesc: "",
productDesc: "",
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