I’m trying to make an extension that will do something after the user has submitted a safecracker form. I’ve created a hook on the safecracker_submit_entry_end and it triggers when the form is submitted, whether it has passed inline validation or not. How do I find out if the form has passed validation in my code? The documentation at http://ellislab.com/expressionengine/user-guide/modules/safecracker/development.html doesn’t mention this at all.
Here is the safecracker code:
{exp:safecracker channel="profile" return="/thank-you" id="publishform" include_jquery="no" author_only="no" error_handling="inline" .... }Hi cfenwick,
As I understand, you are developing an extension that listens for the safecracker_submit_entry_end hook, is that correct?
I would expect that the form would have passed validation if the hook is called, since validation happen inline with the SafeCracker form.
However, we don’t offer support for add-on development, we just aren’t set up to do so. To get you to the right audience, I’m going to move this into Development and Programming.
Cheers!
are you setting the validation rule into safecracker tag
{exp:safecracker channel="profile" return="/thank-you" id="publishform" include_jquery="no" author_only="no" error_handling="inline" .... }like
rules:my_field_name="required|min_length[5]"try it, it may validation the inputs before triggering safecracker_submit_entry_end.
Yes, I’ve got them. here’s the full tag:
{exp:safecracker channel="profile" return="/thank-you"
id="publishform" include_jquery="no" author_only="no"
error_handling="inline"
rules:title="required|min_length[5]"
rules:gp_practice="required"
rules:gp_email="valid_email|required"
rules:gp_address="required"
rules:gp_city="required"
rules:gp_postcode="required"
rules:gp_latitude="required"
rules:gp_longitude="required"
}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.