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 OR Validation?

July 08, 2011 9:12am

Subscribe [3]
  • #1 / Jul 08, 2011 9:12am

    Matt Ellis

    51 posts

    Hello!

    Using Safecracker I have 2 fields (text and file), I need the user to fill in one or the other, or both.

    How would I use Safecrackers built in validation to achieve this?

    Thanks,

    MATTHEW

  • #2 / Jul 11, 2011 5:50am

    John Henry Donovan

    12339 posts

    Hi Matthew,

    If you needed both to be filled in then just make both fields required in their preferences in the EE control panel. or used teh SC rules parameter.

    If it is one or the other then you would need to use something like jQUery’s Validation plugin and check for either of the fields being filled in for the form to submit.

    Does that help?

  • #3 / Jul 11, 2011 12:30pm

    Matt Ellis

    51 posts

    Yes - it’s one or the other.

    JQuery Validation is the way to go I think!

  • #4 / Jul 12, 2011 8:42pm

    Lisa Wess

    20502 posts

    Hi, Matthew -

    It does seem like that would be the better way to go.  Did you want me to shift this down to Community Help for assistance getting that done?

  • #5 / Jul 13, 2011 1:32am

    Matt Ellis

    51 posts

    Hi Lisa,

    Think I’ve got it all sorted now, thank you.

  • #6 / Jul 13, 2011 11:38am

    Sue Crocker

    26054 posts

    Sounds good.. If anything else comes up, please do let us know in a new thread..

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

ExpressionEngine News!

#eecms, #events, #releases