Is it possible to include a Users Fields Type on a front end form? I'd like to allow people to choose existing users on a front end form rather than giving them access to the admin area of the Craft site.
1 Answer
Sure is! You'll want to bookmark this ridiculously handy page, but if you look under "Relations" you'll see the syntax you're looking for:
<select multiple name="fields[fieldHandle][]">
<option value="13">Username One</option>
<option value="42">Username Two</option>
<option value="144">Username Three</option>
</select>
-
Thank you Brad! Would I be able to use code to include all users in a specified user group or do I need to list them all out like the code above?– LoriCommented Jun 23, 2016 at 1:29
-
Just use
craft.users.group
to the ones in the group you're looking for. craftcms.com/docs/templating/craft.users#group– Brad Bell ♦Commented Jun 23, 2016 at 3:47