Developer forum

Forum » Dynamicweb 10 » Render Custom Dropdown on sign up form

Render Custom Dropdown on sign up form

Joseph Vause
Reply

Hello,

I want to render a dropdown on the sign up page how would we do this (without using the input tag as we need to control the styling) is there a get loop tag that we can use?


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

You can loop the custom fields and their options:

https://doc.dynamicweb.com/template-tags/users/extranet/details/usermanagementuser-customfields

Or you can access the field directly using UserManagement:User.[UserCustomFieldSystemName] tags - e.g.

https://doc.dynamicweb.com/template-tags/users/extranet/create-edit/usermanagementuser-usercustomfieldsystemname-input-id for the name for the select input to use in your markup when you submit the selected value.

I do not think there is an option to get the field options from a loop. They are administration information only.

You can get the options like this:

Dynamicweb.Security.UserManagement.Common.CustomFields.CustomField.GetCustomFields("AccessUser")

Find the field with the correct systemname and loop the options - remember null checks:

Dynamicweb.Security.UserManagement.Common.CustomFields.CustomField.GetCustomFields("AccessUser").SingleOrDefault(x => x.SystemName == "myField").Options

 

You must be logged in to post in the forum