HSC COde edit and add new Hsc updated

This commit is contained in:
KarthiKKVardhan 2026-05-05 18:10:51 +05:30
parent 62f7913076
commit ffb1eaad8f

View File

@ -895,6 +895,21 @@ const IsicHsCodes = () => {
const handleFormChange = (field) => (event) => {
const value = event?.target?.value ?? event;
if (field === "weight") {
// Allow only numbers + optional decimal
if (!/^\d*\.?\d*$/.test(value)) return;
// Split integer & decimal parts
const [intPart = "", decPart = ""] = value.split(".");
if (intPart.length > 2) return;
if (decPart.length > 10) return;
}
setForm((prev) => ({ ...prev, [field]: value }));
};