I am using BotFramework WebChat 4.9.1
and adaptive card 1.2
and I need few fields to be mandatory. Following is the card I have tried but it does not work. Ideally on submit it should highlight with red text that First name is required if the text box is empty.
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": 2,
"items": [
{
"type": "TextBlock",
"text": "Email Sign Up Form",
"weight": "Bolder",
"size": "Medium"
},
{
"type": "TextBlock",
"text": "You'll get timely email notification",
"isSubtle": true,
"wrap": true
},
{
"type": "Container",
"$data": "properties",
"items": [
{
"type": "TextBlock",
"text": "First Name*",
"weight": "Bolder",
"wrap": true
},
{
"type": "Input.Text",
"id": "firstName",
"placeholder": "First Name",
"Required": true,
"requiredMessage": "First Name is required"
},
{
"type": "TextBlock",
"text": "Last Name*",
"weight": "Bolder",
"wrap": true
},
{
"type": "Input.Text",
"id": "lastName",
"placeholder": "Last Name",
"Required": true,
"requiredMessage": "Last Name is required"
},
{
"type": "TextBlock",
"text": "Email*",
"weight": "Bolder",
"style": "email",
"wrap": true
},
{
"type": "Input.Text",
"id": "email",
"placeholder": "Your Email",
"Required": true,
"requiredMessage": "email is required"
},
{
"type": "TextBlock",
"text": "DOB*",
"weight": "Bolder",
"wrap": true
},
{
"type": "Input.Date",
"id": "dob",
"value": "2017-09-20",
"Required": true,
"requiredMessage": "Please select you date of birth"
}
]
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"result": "submit"
}
}
]
}
The Json above you can try in Design You Adaptive Card Here Please select the Host app and Target Version from the designer tool. Please help. Is it possible with adaptive card targeted for WebChat or this I'll have to achieve in front end?
Required
andrequiredMessage
instead of the propertiesisRequired
anderrorMessage
like you can see in the schema? adaptivecards.io/explorer/Input.Text.html – Kyle DelaneyisRequired
anderrorMessage
but there are no reasons for that I haveRequired
andrequiredMessage
, I was doing some trials and errors to see if something is going to work. – Satish PatelisRequired
was introduced in Adaptive Cards 1.3 and Web Chat only supports Adaptive Cards 1.2.6? – Kyle Delaney1.2
because I am using webchat for UI. – Satish Patel