Expandir la barra de logros de la comunidad.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
RESUELTAS

Creating Mandatory field in input form

Avatar

Level 2

Hello Team,

 

I'm looking to enforce mandatory fields in the delivery form to ensure nobody leaves them empty. I've tried using the "required" attribute along with the "leave" tag as suggested in the documentation, but it doesn't seem to be working.

 

Could you please suggest an alternative approach or guide me on how to properly implement this?

 

 

Thanks,

Ankita Vishe

1 solución aceptada

Avatar

Respuesta correcta de
Level 3

I've just recently set up a web form which has required fields - I was able to achieve this using:

 

<input
##all your other normal values here##
required="required"
aria-required="true"
data-nl-ismandatory="true"
/>

Ver la solución en mensaje original publicado

9 Respuestas

Avatar

Community Advisor

Hi @AnkitaV3131 ,

required="true" will make the field's label display in Red color font. But it will still allow empty value.

<leave> tag will make a field mandatory in input form by throwing an error pop-up when the field is empty.

Example,

<input label="Internal Name" required="true" xpath="@internalName"/>
<leave>
	<check expr="@internalName !=''">
		<error>Internal Name is Mandatory</error>
	</check>
</leave>

Avatar

Level 2

Hi Partha,

Already tried this but this is not working.

Thanks,

Ankita

Avatar

Level 7

Hello @AnkitaV3131, if your field can be null, maybe it's a null value and you aren't checking it. You should try this check in the leave element.

<check expr="@field != NULL and @field != ''">

 Hope this helps!

Avatar

Level 7

This seems logic, have you tried it @AnkitaV3131?

Avatar

Level 2

Hi,

I am trying will let you know once done.

Thanks
Ankita Vishe

Avatar

Level 2

Hi Heku,

This is also not working.

Avatar

Community Advisor

@AnkitaV3131 , @Share us the script you used in input form for making the field mandatory, and the attribute structure in the schema.

Avatar

Respuesta correcta de
Level 3

I've just recently set up a web form which has required fields - I was able to achieve this using:

 

<input
##all your other normal values here##
required="required"
aria-required="true"
data-nl-ismandatory="true"
/>

Avatar

Administrator

Hi @AnkitaV3131,

Was the given solution by @ALangridge helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!



Sukrity Wadhwa