How to create Dropdown required message

UI Components for React
Post Reply
hrn07
Posts: 1
Joined: 06 Jan 2022, 15:32

06 Jan 2022, 16:02

Hi ,
First of all sorry for my bad english level.
I have a project with primereact sakai template. I used primereact dropdown but I didn't custom error message for required attribute.

<Dropdown
name="unitId"
onChange={handleChange}
value={id}
options={units}
optionLabel="unitName"
optionValue="id"
filter
showClear
filterBy="unitName"
placeholder="Select a Unit"
required
/>

I am using required attribute as in this code example. When I want to submit the form with Submit button my page does not post ok, but I can't see the error message anywhere on the page.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

16 Jan 2022, 18:12

I suggest checking out the showcase for Form Validation examples: https://primefaces.org/primereact/formik/
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests