#assign codes = list_ants_codes![]>
<#assign places = nbPlacesToTake!1>
<#macro codeHelp>
#i18n{module.appointment.ants.predemandeserial.help} <@cLink href='https://ants.gouv.fr/' label='ants.gouv.fr' target='_blank' />
#macro>
<@cContainer>
<@cTitle level=2 class='mb-3' id='step1'>#i18n{module.appointment.ants.appointmenttitresearch.form.legend}@cTitle>
<@cRow>
<@cCol cols='12 col-sm-6'>
<#list (errors![]) as error>
<@cAlert type='danger' title=error.message />
#list>
<@cForm action='jsp/site/Portal.jsp' id='predemande_form'>
<@cInput type='hidden' name='page' value='appointmentants' class='' />
<@cInput type='hidden' name='starting_date_time' id='starting_date_time' value=starting_date_time!'' class='' />
<@cInput type='hidden' name='id_form' id='id_form' value=id_form!'' class='' />
<@cLabel for='nbPlacesToTake' label='#i18n{module.appointment.ants.predemandenumber.label}' required=true />
<@cInput type='number' name='nbPlacesToTake' id='nbPlacesToTake' value='${places}' min=1 max=max_places_to_take step=1 required=true html5Required=true class='form-control w-25' helpMsg='#i18n{module.appointment.ants.predemandenumber.help}' />
<#list 1..max_places_to_take as i>
hidden#if>>
<#assign labelKey = ( i == 1 && places == 1 )?then( 'default', i?c )>
<@cLabel for='predemande_code_${i}' label='' required=true>
#i18n{module.appointment.ants.predemandeserial.label_${labelKey}}@cLabel>
<@cInput name='predemande_code_${i}' id='predemande_code_${i}' value=(codes[i-1])!'' pattern='[A-Z0-9]{10}' maxlength=10 required=true html5Required=(i lte places) autocomplete='off' title='#i18n{module.appointment.ants.predemandeForm.customValidityMessage}' params=(i gt places)?then('disabled', '') />
<@codeHelp />
#list>
<@cBtn label='#i18n{portal.util.labelValidate}' type='submit' class='primary' params='name="action_presearch"'><@cIcon name='check' class='me-1' />@cBtn>
@cForm>
@cCol>
<@cCol cols='12 col-sm-6'>
@cCol>
@cRow>
@cContainer>