How to assign error messages via wpforms_process
-
Hi all,
Would like a little help on using wpforms_process() to assign error message to a field with type name. A name typed field includes 3 possible subfields including first, middle and last. I find the error message only gets to highlight the last name part as there is no way of specifying which subfield to highlight. It doesn’t allow assigning to only the first name.
The way the error message is assigned is:
wpforms()->process->errors[$form_id][$field_id] = esc_html__('message', 'wpforms');
A sample public form response ajax submission returns:
{"success":false,"data":{"errors":{"general":{"header":""},"field":{"wpforms[fields][0][last]":"message"}}}}
Any help would be appreciated. Thanks.
The page I need help with: [log in to see the link]
- The topic ‘How to assign error messages via wpforms_process’ is closed to new replies.