import { Form } from "web3uikit"
import React from "react"
function SellSwapForm({ title, id, onSubmit, extraFields = [] }) {
const commonFields = [
{
name: "NFT Address",
type: "text",
inputWidth: "100%",
key: "nftAddress",
validation: {
regExp: /^(0x)[0-9a-fA-F]{40}$/,
regExpInvalidMessage:
"Please enter a valid Ethereum address in the format 0x1234...",
required: true,
},
]
const allFields = [...commonFields, ...extraFields]
return (
<>
<Form onSubmit={onSubmit} data={allFields} title={title} id={id} />
</>
)
}
export default SellSwapForm
I am validating a nftAddress here if the address is not correct i'm getting the regExpInvalidMessage but if the nftAddress is correct i get the message "Deine Eingabe muss mit dem geforderten Feld übereinstimmen" this is the message i see when address is correct this is the rendered content with the inputField*/}
I only need my own validation like it is above. I already tried to change the type: "text" to "textarea" also i tried to set noValidation/novalidation and i tried to use pattern. btw. i already asked chatGPT...