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 form validation for multiple fields

April 25, 2011 10:55am

Subscribe [2]
  • #1 / Apr 25, 2011 10:55am

    welshartnow

    81 posts

    I wish to validate my safecracker form fields and am using rules:your_custom_field_name=“required|min_length[5]” to validate field1 and that works fine.  My question is how do I validate more that a single field not sure on the syntax. Tried rules:field1=“required”,field2=“required” but with no luck.  I need to use this with multiple fields.

  • #2 / Apr 25, 2011 6:26pm

    Sue Crocker

    26054 posts

    Hi, welshartnow..

    I found this over on the older SafeCracker forum:

    {exp:safecracker channel="contact" return="thanks" rules:contact_name="required" rules:contact_phone="required" rules:contact_email="required"}

    Does that help?

  • #3 / Apr 26, 2011 6:06am

    welshartnow

    81 posts

    Sue you are an angel, greatly appreciated, one minor gripe my safecracker braces are getting longer and longer!

  • #4 / Apr 26, 2011 5:20pm

    Sue Crocker

    26054 posts

    I just copied and pasted. 😊 Glad that worked for you. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases