Expand my Community achievements bar.

SOLVED

input form mandatory field

Avatar

Level 4

@All 

 

how can we make a files mandatory in input form

i read the documenttation..

somewther mentioemd we need tk use leave tag 

and some where mentioned we need to pit required=true

 

m confused

 

pelase help

 

@isahore

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @DishaSharma ,

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>

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @DishaSharma ,

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>

 

I tried this, but its not throwing any error if left empty.

 

Tried all below types

1.

<input colspan="1" label="Template Name" menuId="deliveryMenuBuilder" name="templateName" required="true" type="scriptEdit" xpath="/delivery/content/whatsapp/@templateName"
xpathInsert="/ignored/customizeWABAContent">
<leave>
<check expr="[content/whatsapp/@templateName] !=''">
<error>Template Name is Mandatory</error>
</check>
</leave>
</input>

 

2.

<input colspan="1" label="Template Name" menuId="deliveryMenuBuilder" name="templateName" required="true" type="scriptEdit" xpath="/delivery/content/whatsapp/@templateName"
xpathInsert="/ignored/customizeWABAContent" />

<leave>
<check expr="[content/whatsapp/@templateName] !=''">
<error>Template Name is Mandatory</error>
</check>
</leave>

 

3.

<input colspan="1" label="Template Name" menuId="deliveryMenuBuilder" name="templateName" required="true" type="scriptEdit" xpath="/delivery/content/whatsapp/@templateName"
xpathInsert="/ignored/customizeWABAContent" />
<leave>
<check expr="@templateName !=''">
<error>Template Name is Mandatory</error>
</check>
</leave>

Nothing above worked.