diff --git a/src/components/forms/formGenerator.js b/src/components/forms/formGenerator.js index 8cb9b9e..dee4d89 100644 --- a/src/components/forms/formGenerator.js +++ b/src/components/forms/formGenerator.js @@ -129,18 +129,35 @@ export const FormGenerator = ({ * { * type: 'text', * name: 'name', - * ref: React.createRef() + * ref: React.createRef(), + * onChange: null OR validationFunc + * validationInfo: null OR useState("") * } } input - basic text input * @param { * { * type: 'info', - * action: 'Update' + * action: 'Update', * endpoint: 'Album' * } } info - information about form */ const TextInputGenerator = ({ input, info }) => { + + const [textInputValidationInfo, setTextInputValidationInfo] = useState("Empty") + + const inputRegex = /^[^'";<>=]+$/ + + const defaultValidation = (event) => { + if (event.target.value === "") { + setTextInputValidationInfo("Empty") + } else if (!inputRegex.test(event.target.value)) { + setTextInputValidationInfo("Please provide correct value") + } else { + setTextInputValidationInfo("Success") + } + } + return (
- Minimize your expenses without compromising on quality.
-
- Our platform is built for individuals who need top-tier rendering
-
-
- without the top-tier investment.
-
-
- ...But GPU server can be very expensive.
-
- Configuration and administration take too long time.
-
-
- Everything of that needs so much additional knowledge.
-
-
- Boost your GPU power for your 3D and AI models stuff
-
-
- without overpay for servers...
-
-
-
- ...without overtime for environment adjustments!
-
-
- We only win if you win. You won't carry all the risk, we'll share it -
-- Our first priority is to get you results. -
--
--
-
+ Minimize your expenses without compromising on quality.
+
+ Our platform is built for individuals who need top-tier rendering
+
+
+ without the top-tier investment.
+
+
+ ...But GPU server can be very expensive.
+
+ Configuration and administration take too long time.
+
+
+ Everything of that needs so much additional knowledge.
+
+
+ Boost your GPU power for your 3D and AI models stuff
+
+
+ without overpay for servers...
+
+
+
+ ...without overtime for environment adjustments!
+
+
+ We only win if you win. You won't carry all the risk, we'll share it +
++ Our first priority is to get you results. +
++
++
+