ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

customized error messages on user registration form

March 11, 2009 4:03pm

Subscribe [5]
  • #1 / Mar 11, 2009 4:03pm

    JayTee

    108 posts

    (I come from a codeIgniter background - so bear with me)
    When a member is registering on my site, I want to show a per-field error message; similar to the CodeIgniter form_error(‘field_name’) function with the form_validation library.

    From what I can see, the member registration page; and even the suggested wiki entry for a “standalone” registration form don’t address this capability.

    I’d like to be able to do something like this:

    //this is just for demonstration - i know this function doesn't exist
    {form_declaration}
    <fieldset><legend>{lang:login}</legend>
    <div {if form_error('username')}class="error"{/if}>
    {form_error('username')}
    <label for="username">{lang:username}</label>
    <input type="text" class="textInput" name="username">
    </div>
    </fieldset>
    <input type="submit" value="{lang:submit_button}">
    </form>

    From what I can see in the Solspace extension, the EE documentatin, and the wiki - all errors are sent to the “specialty template” for displaying errors.

    Do I have a choice on this behavior or am I going to have to do a blended CI/EE install to get this to work how I want it to?

    Moved to HowTo by Moderator

  • #2 / Mar 11, 2009 4:09pm

    Ingmar

    29245 posts

    ... all errors are sent to the “specialty template” for displaying errors.

    That is correct.

    Do I have a choice on this behavior or am I going to have to do a blended CI/EE install to get this to work how I want it to?

    You might be able to use an extension to do your own error handling. There is nothing like that built into EE, though. If you want to discuss this further, I can move this thread to Howto for you if you want me to.

  • #3 / Mar 12, 2009 10:59am

    JayTee

    108 posts

    I’m thinking I don’t have much of a choice at this rate - may as well move it to “howto”

  • #4 / Mar 12, 2009 11:01am

    Sue Crocker

    26054 posts

    Moving per request.

  • #5 / Mar 12, 2009 11:26am

    hothousegraphix

    851 posts

    You might try using this jquery field validation plugin. Forgive me if you’re already aware of it. There are some nice examples of what is possible.

  • #6 / Mar 12, 2009 11:47am

    JayTee

    108 posts

    I was hoping for some customized server-side validation; but this is a nice jQuery plugin 😊

    I’m looking at the EE architecture to see what it will take to just write my own extension.  I’m hoping it’s similar to CodeIgniter (one came from the other, right?)

    If the time factor for the extension is too long, I’ll likely end up doing a CI/EE one-two punch just to get this finished.

  • #7 / May 19, 2009 10:02am

    bo-oz

    126 posts

    Any luck with writing the extension up till now?

  • #8 / May 19, 2009 10:05am

    JayTee

    108 posts

    Not so far - It’s in progress: EE is more different than CI than I had originally anticipated

  • #9 / May 19, 2009 10:11am

    bo-oz

    126 posts

    Not so far - It’s in progress: EE is more different than CI than I had originally anticipated

    I think the rebuild on the CI framework will be as of version 2.0… CI already has custom validation build in I guess (am only familiair with CakePHP, which does offer a OOTB solution).

    If you are indeed building it… how are you planning to implement this? Will it be an ad-hoc, per <form>, way or will it be an option for custom fields?

  • #10 / May 19, 2009 12:17pm

    JayTee

    108 posts

    If you are indeed building it… how are you planning to implement this? Will it be an ad-hoc, per <form>, way or will it be an option for custom fields?

    My goal is to make it work within EE templates on a per-form basis.
    The difficult part in this (for me) is that EE isn’t really designed as a mechanism for user input.  It’s designed to be a publishing platform. (it’s kind of one-way in that regard)  Therefore the only data manipulation occurs from the administrative side.
    If I want to incorporate a user form (like a form asking for more information or something), there’s no feedback mechanism in place in EE for me to process the user’s input:
    The CI way ->
      form posts to controller
      controller processes data
      form is redisplayed if there are errors - with error messages
      success message (or whatever you want) if the form was successfully posted

    The EE way ->
      form can be created in the template
      no EE tags in a template to process a posted form - so it doesn’t go anywhere

    The closest thing is the ability to have dynamic parameters on viewing content; which isn’t what I’m looking for.

    So anyway, I’ll continue on my development path and see what I can come up with.  To get the app out the door, I already did a combination of CI/EE on that particular site - it just needed to get done.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases