I need to get two text fields under the same custom form and have it return two different values to be stored in the database. Right now with what I have, it's storing the same variable for both, which I get why it's happening, but I can't come up with a viable solution to return two values.
setting the field
{% import "_includes/forms" as forms %}
{{ forms.textField({
label: 'Value 1',
instructions: 'test',
name: name,
style: 'width: 50%',
value: value})
}}
{{ forms.textField({
label: 'Value 2',
instructions: 'test',
name: name,
style: 'width: 50%',
value: value})
}}
Field function:
public function getInputHtml($value, ElementInterface $element = null): string
{
return Craft::$app->getView()->renderTemplate('custom-plugin/cloudinary_field',
[
'name' => $this->handle,
'value' => $value,
'field' => $this,
]
);
}
How can I make these two text fields each return a value to be stored in the database?