Skip to main content

How to use vibe design Textfield for form submission

  • January 30, 2025
  • 1 reply
  • 14 views

I need to submit a form using TextField from vibe design. Here is my issue.
Each time i tried to submit a form, it throws error Cannot read property ‘value’ of undefined
TypeError: Cannot read property ‘value’ of undefined
** at handleChange**

Here is the code

// import goes here


const MyForm = () => {
  const [inputValue, setInputValue] = useState('');

  const handleChange = (event) => {
    setInputValue(event.target.value);
     console.log("event target value", event.target.value);
  };

  const handleSubmit = (event) => {
    event.preventDefault();
    console.log("Submitted Value:", inputValue);
    // Here you can make calls to API
  };

  return (
    <form onSubmit={handleSubmit}>
      <div>
        <TextField
          placeholder="Testing Form"
          size="medium"
          title="Testing"
          type="text"
          value={inputValue}
          onChange={handleChange}
        />
      </div>
       <div>
      <Button kind="primary" type="submit">Submit</Button>
        </div>
    </form>
  );
};

export default MyForm;

1 reply

Forum|alt.badge.img
  • monday.com Team Member
  • January 31, 2025

hey @fredo

Bill here from monday.com 👋

Would you be able to please fill this form adding as much information as possible to it (such as account ID, board IDs, item IDs, timestamps, etc.) so that our team can take a look into it?

Cheers,
Bill