How do I make a Playa select field required in my Safecracker rules?

I have a playa field in my safecracker form as follows. The field generally works fine, but I cannot get Safecracker to require it. I've tried rules:training_teams="required".

<select id="training_teams" name="training_teams[selections][]">
    <option value="">Select Race</option>
    {embed="includes/_training_teams" selected="{training_teams:child_ids}"}

The embed file is as follows:

{exp:channel:entries dynamic="no" status="open" channel="rally_athlete_program" 
    orderby="title" sort="asc" date_field="event_date"
date_field_start="{current_time format='%Y-%m-%d'} 12:01 AM"}
    <option value="{entry_id}">{if entry_id == embed:selected}selected{/if}{title}</option>
  • have you tried setting the field itself to required in the fieldtype settings?
    – GDmac
    Jan 15 '13 at 8:27
  • Stacey, could you answer below so this question goes off the unanswered list? Cheers. Jan 15 '13 at 17:55

Playa has respected EE’s “Is this a required field?” field setting since version 4.0.5. Simply set that setting to “Yes” and save your field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.