Hello, sorry if my title is confusing, i'm not really sure how to explain it but i'll give it a go.

I have a form. The fields are generated using a replicator fieldtype. Inside this replicator I set a label, a placeholder, a form field (corresponds to the handler inside the form i created).

First and foremost, I need the errors to be inline.

But also very important, I need to check if a specific key exists inside the error array. If it does, I need to do special things (like set a class or display the value)

{{ form:create in="myform" }}
    {{ my_replicator_handler }}
        <div class="col-xs-12 {{ field_size }}">
            <div class="form-field">
                {{ if error:first_name }}
                    <div class="error-message text-right">* {{ error:first_name }}</div>
                {{ /if }}
                <div class="{{ if error:first_name }} has-error {{ /if }}">
                    <label>{{ label }}</label>
                    <input type="text" name="{{ form_field }}" placeholder="{{ placeholder }}" value="{{ old:first_name }}" />
    {{ /my_replicator_handler }}
    <div class="col-xs-12">
        <button class="pull-right" type="submit">Submit</button>
{{ /form:create }}

You see where the if error:first_name is? I need that to be a variable instead because not all fields are required. So i need to change it to {{ error:form_handler }} but where form_handler is a variable i set in my replicator.

I guess this would be the same for the old array since i'm assuming it will have the same problem...

Is there any way to do this? I tried modifiers and whatnot but have not been able to... any help will be greatly appreciated.

Thank you.