Creating an AJAX registration process with all the bells and whistles of a typical modern signup form used to be pretty hard in EE. Well, not any more – since we just added AJAX support to Simple Registration!
Using the ajax=’y’ parameter in the {exp:simple_registration:form} tag you can now get the responses in JSON format. Nice huh?
Check out this error response for example:
{
"status" : "error",
"title" : "Error"
"heading" : "The form you submitted contained the following errors",
"content" : "
- The username you chose is not available
\n
- The password you submitted must be at least 5 characters long
\n
- You did not submit a valid email address
\n
- The following field is required: First Name
\n
",
"content_no_tags" : "The username you chose is not available\nThe password you submitted must be at least 5 characters long\nYou did not submit a valid email address\nThe following field is required: First Name\n",
"error_fields" : { "br_fname" : { "error_key" : "mbr_field_required",
"message" : "The following field is required: First Name"
},
"email" : { "error_key" : "invalid_email_address",
"message" : "You did not submit a valid email address"
},
"password" : { "error_key" : "none",
"message" : "The password you submitted must be at least 5 characters long"
},
"username" : { "error_key" : "username_taken",
"message" : "The username you chose is not available"
}
},
"redirect" : "",
"link" : [ "JavaScript:history.go(-1)",
"Return to Previous Page"
],
}
Notice the error_fields array which can be used to tell which fields that failed and what the problem was with each one. Perfect for outputting contextual error messages (like making the email input red for instance).
Have fun AJAXifying your signup forms!
Grab the latest version in your account or buy it here.



