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.

SAEF handling of empty required fields

April 28, 2010 4:20pm

Subscribe [3]
  • #1 / Apr 28, 2010 4:20pm

    Opaline

    71 posts

    What is the default behavior supposed to be for an SAEF form when required fields are left empty?

    Right now, if a required field is left empty in my SAEF, the user sees a page which lists the empty fields but also displays a control-panel style entry form. Is that the expected behavior or do I have an anomalous situation?

    Edit: actually, that was because I left CP access on for that member group. If I turn off CP access, the user sees a CP login form, no notification about missing required fields. The user is logged in to the site, because he is able to see the SAEF (which is otherwise unavailable to him) so I’m not sure why the direction to the CP is happening.

    What I’d like to happen is to show the missing fields notice, and then redirect to the form page, ideally pre-populated with whatever content has been entered so far. I’m trying to keep these users from seeing the CP form, which contains tabs for fields that are only relevant for our editors, like date and options.

    Suggestions?

    thanks!!!

    (I’m using version 1.6.7)

  • #2 / Apr 28, 2010 4:45pm

    Ingmar

    29245 posts

    Right now, if a required field is left empty in my SAEF, the user sees a page which lists the empty fields but also displays a control-panel style entry form. Is that the expected behavior or do I have an anomalous situation?

    That sounds fine, yes.

    What I’d like to happen is to show the missing fields notice, and then redirect to the form page, ideally pre-populated with whatever content has been entered so far. I’m trying to keep these users from seeing the CP form, which contains tabs for fields that are only relevant for our editors, like date and options.

    I am afraid that is not an option as such at this point. You might be able to use some Ajax to to some field checking, it’s what I’d do.

  • #3 / Apr 28, 2010 5:01pm

    Opaline

    71 posts

    thanks very much for speedy reply Ingmar. Not what I wanted to hear, but I think we can find a way to deal with it. I wonder if there are some wiki articles on this aspect of SAEF handling.

    Typically, if a developer wants to use the SAEF, they don’t want that user going to the CP or depending on the CP for validation (or javascript alone for that matter.)

  • #4 / Apr 28, 2010 5:08pm

    Ingmar

    29245 posts

    I am not aware of any wiki article, but I am sure people have been doing something like that. Let me move this thread to Howto for some additional community input.

  • #5 / Apr 29, 2010 6:06pm

    dstechroom

    113 posts

    I haven’t been able to look into this (yet - I think I will have to be for a project I’m working on), but is there a hook for SAEF form submissions for use in an extension? Or perhaps any other hook that can be used for the purpose?

    I think that if we have a hook we can use, then we can perform our own validation, etc, before letting EE handle the rest (so the hook would have to be before EE handles the form submission code itself, and then not interfere with EE processing the form if all the data validates).

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

ExpressionEngine News!

#eecms, #events, #releases