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.

SafeCracker problems with required fields not validating / Disallowed Key Characters

July 17, 2012 8:39am

Subscribe [2]
  • #1 / Jul 17, 2012 8:39am

    doubleplusgood

    199 posts

    Hi there,

    I have a SafeCracker form with 3 required fields in an EE 2.5.2 build. However, when I enter information correctly in each field and click submit, I then get the errors saying that each field is required, despite completing them.

    The form is as follows;

    {exp:safecracker
     channel="contact_us"
     dynamic_title="Enquiry from [cf_contact_us_name]"
     id="contactus"
     return="contact/thank-you-for-contacting-us"
     datepicker="no"
     error_handling="inline"
     include_jquery="yes"
     class="grey"
     logged_out_member_id="1"
    }
    <fieldset>
    <legend>Drop us a line</legend>
    <ul>
    <li><input type="text" name="{cf_contact_us_name}" id="{cf_contact_us_name}" placeholder="Your name"><span>*</span>
    {if error:cf_contact_us_name}<span class="error">{error:cf_contact_us_name}</span>{/if}</li>
    
    <li><input type="text" name="{cf_contact_us_telemail}" id="{cf_contact_us_telemail}" placeholder="Your email or telephone"><span>*</span>
    {if error:cf_contact_us_telemail}<span class="error">{error:cf_contact_us_telemail}</span>{/if}</li>
    
    <li><textarea name="{cf_contact_us_enquiry}" id="{cf_contact_us_enquiry}" placeholder="How can we help?"></textarea><span>*</span> {if error:cf_contact_us_enquiry}<span class="error">{error:cf_contact_us_enquiry}</span>{/if}</li>
    <li><button class="button" type="submit">Send</button></li>
    </ul>
    </fieldset>
    {/exp:safecracker}

    The strange thing is that this worked on a previous development server and now I have moved it to a production server it no longer works.

    I also had an issue with Disallowed Key Characters but resolved that using the fix at https://support.ellislab.com/bugs/detail/16909.

    Grateful for any help with this.

  • #2 / Jul 17, 2012 4:50pm

    Shane Eckert

    7174 posts

    Hey Neil,

    This sounds really similar to this 2.5.2 bug aside from the fact that you do not have a file required here.

    Is this all of the form, or is there more that you just set aside for the example?

    Please let me know. This sounds like a similar bug.

    Cheers,

  • #3 / Jul 17, 2012 5:41pm

    doubleplusgood

    199 posts

    Hey Shane,

    That’s all there is to the form.

    Regards,
    Neil

  • #4 / Jul 18, 2012 3:43pm

    Shane Eckert

    7174 posts

    Hey Neil,

    Okay, so I tried a form without the fieldsets. The more “traditional” form method if you will. That works with no issues for me.

    I then tried with your example and I get the same results. It seems to be a bug, though I wonder why it worked on one server for you and then not another.

    Can you double check your development server and see if they are identical? Anything that’s different I would be interested in knowing. The fact that it worked on one server but not another, including mine, makes me want to hold off on filing a bug for now.

    Thank you,

     

  • #5 / Jul 18, 2012 3:50pm

    doubleplusgood

    199 posts

    Hey Shane,

    I just double checked my development server and it seems that the form isn’t working there either. I remembered the last time I checked it was before I upgraded to EE 2.5.2.

  • #6 / Jul 18, 2012 3:53pm

    Shane Eckert

    7174 posts

    Hey Neil,

    Yay for sanity!

    So this is a bug. You want to file it? If not, I can do it and then you can comment on it to stay up to date on the progress.

    Looks like this bug is present only if you use the fields.

    Cheers,

  • #7 / Jul 18, 2012 4:20pm

    doubleplusgood

    199 posts

    Hey Shane,

    That would be great if you can file it. You might be able to write it in a more logical way for the guys to fix. 😊

    So is the solution to write the fields using the safecracker tags instead of standard html inputs like I have used?

  • #8 / Jul 18, 2012 5:55pm

    Shane Eckert

    7174 posts

    Hey Neil,

    Yes, it worked for me. Can you try that and see if it fixes it?

    I will hold off on the bug just to make sure.

    Cheers,

  • #9 / Jul 19, 2012 7:53am

    doubleplusgood

    199 posts

    Thanks Shane. Seems to be working now. Would be good to get it working like I had before, particularly for html5 elements like placeholder.

  • #10 / Jul 19, 2012 4:17pm

    Shane Eckert

    7174 posts

    Hey Neil,

    Thank you for confirming. Appreciate all your help with this.

    Bug has been filed and hopefully it will be addressed very soon. Please comment on the bug to stay up to date with the fix and any quick fixes the Devs might put in there.

    Is there anything else I can help you with?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases