33import { Icon } from '@equinor/eds-core-react'
44import { error_filled } from '@equinor/eds-icons'
55import { useLocale , useTranslations } from 'next-intl'
6- import { type BaseSyntheticEvent , useMemo , useState } from 'react'
6+ import { type BaseSyntheticEvent , useId , useMemo , useState } from 'react'
77import { Controller , useForm , useWatch } from 'react-hook-form'
88import { Button } from '@/core/Button'
99import { Checkbox } from '@/core/Checkbox/Checkbox'
@@ -37,6 +37,7 @@ const CareersContactForm = () => {
3737 const [ isFriendlyChallengeDone , setIsFriendlyChallengeDone ] = useState ( false )
3838 const [ isServerError , setServerError ] = useState ( false )
3939 const [ isSuccessfullySubmitted , setSuccessfullySubmitted ] = useState ( false )
40+ const formId = useId ( )
4041
4142 const {
4243 handleSubmit,
@@ -148,7 +149,7 @@ const CareersContactForm = () => {
148149 } ) => (
149150 < TextField
150151 { ...props }
151- id = { props . name }
152+ id = { ` ${ props . name } _ ${ formId } ` }
152153 label = { `${ intl ( 'name' ) } *` }
153154 inputRef = { ref }
154155 aria-required = 'true'
@@ -178,7 +179,7 @@ const CareersContactForm = () => {
178179 } ) => (
179180 < TextField
180181 { ...props }
181- id = { props . name }
182+ id = { ` ${ props . name } _ ${ formId } ` }
182183 label = { `${ intl ( 'careers_contact_form_phone' ) } *` }
183184 description = { intl ( 'country_code_format' ) }
184185 type = 'tel'
@@ -210,7 +211,7 @@ const CareersContactForm = () => {
210211 } ) => (
211212 < TextField
212213 { ...props }
213- id = { props . name }
214+ id = { ` ${ props . name } _ ${ formId } ` }
214215 label = { `${ intl ( 'email' ) } *` }
215216 inputRef = { ref }
216217 inputIcon = {
@@ -231,7 +232,7 @@ const CareersContactForm = () => {
231232 < Select
232233 { ...props }
233234 selectRef = { ref }
234- id = { props . name }
235+ id = { ` ${ props . name } _ ${ formId } ` }
235236 label = { intl ( 'category' ) }
236237 >
237238 < option value = '' >
@@ -277,7 +278,7 @@ const CareersContactForm = () => {
277278 } ) => (
278279 < TextField
279280 { ...props }
280- id = { props . name }
281+ id = { ` ${ props . name } _ ${ formId } ` }
281282 label = { `${ intl ( 'careers_contact_form_position' ) } ${ setPositionIdMandatory ? '*' : '' } ` }
282283 inputIcon = {
283284 invalid ? (
@@ -310,7 +311,7 @@ const CareersContactForm = () => {
310311 } ) => (
311312 < TextField
312313 { ...props }
313- id = { props . name }
314+ id = { ` ${ props . name } _ ${ formId } ` }
314315 label = { `${ intl ( 'careers_contact_form_location' ) } *` }
315316 description = { intl (
316317 'careers_contact_form_location_placeholder' ,
@@ -335,7 +336,7 @@ const CareersContactForm = () => {
335336 < Select
336337 { ...props }
337338 selectRef = { ref }
338- id = { props . name }
339+ id = { ` ${ props . name } _ ${ formId } ` }
339340 label = { intl ( 'careers_contact_form_candidate_type' ) }
340341 >
341342 < option value = '' >
@@ -368,7 +369,7 @@ const CareersContactForm = () => {
368369 } ) => (
369370 < TextField
370371 { ...props }
371- id = { props . name }
372+ id = { ` ${ props . name } _ ${ formId } ` }
372373 label = { `${ intl ( 'careers_contact_form_questions' ) } *` }
373374 inputRef = { ref }
374375 multiline
0 commit comments