I want to build an input form using text-input, in which I want to display multiple text fields in one form. Making a single view having multiple text fields not providing the output.
So, would it possible to write multiple text-input in a single form or not.
Below is my code which I am trying to implement:
Action:
action (CardDetails) {
type(Search)
collect{
input (creditCard) {
type (CreditCard)
min (Required)
}
input (cvv) {
type (Cvv)
min (Required)
}
}
output (getCardInfo)
}
Structure:
structure (getCardInfo){
property (creditCard) {
type (CreditCard)
min (Optional)
}
property (cvv) {
type (Cvv)
min (Optional)
}
}
Input View:
input-view {
match {
CreditCard (creditCard) {
to-input: CardDetails
}
}
message {
template ("Enter Card Details")
}
render {
form {
elements {
text-input {
id (creditCard)
label (Credit Card)
type (CreditCard)
max-length (20)
value ("#{raw(creditCard)}")
}
text-input {
id (cvv)
label (cvv)
type (Cvv)
max-length (4)
}
}
on-submit {
goal: CardDetails
value: viv.core.FormElement(creditCard)
value: viv.core.FormElement(cvv)
}
submit-button (Ok)
}
}
}
Result View :
result-view {
match: getCardInfo(res){
from-output : CardDetails
}
message{
template ("Here are the details")
}
}
Unable to display result view. Showing I need CVV details to continue.
Any Help on this, Please