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
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
July 08, 2011 9:12am
Subscribe [3]#1 / Jul 08, 2011 9:12am
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
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
Yes - it’s one or the other.
JQuery Validation is the way to go I think!
#4 / Jul 12, 2011 8:42pm
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
Hi Lisa,
Think I’ve got it all sorted now, thank you.
#6 / Jul 13, 2011 11:38am
Sounds good.. If anything else comes up, please do let us know in a new thread..