Skip to content

Commit d0aa129

Browse files
committed
WIP #3194
1 parent 3ece488 commit d0aa129

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

web/templates/forms/CareersContactForm.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Icon } from '@equinor/eds-core-react'
44
import { error_filled } from '@equinor/eds-icons'
55
import { useLocale, useTranslations } from 'next-intl'
6-
import { type BaseSyntheticEvent, useMemo, useState } from 'react'
6+
import { type BaseSyntheticEvent, useId, useMemo, useState } from 'react'
77
import { Controller, useForm, useWatch } from 'react-hook-form'
88
import { Button } from '@/core/Button'
99
import { 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

Comments
 (0)