user profile custom fields

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
4/16/2015 4:33:51 PM
Gravatar
Total Posts 16

user profile custom fields

I have several custom fields in the user profile that are using the optionList.  They are marked as required for registration, but when the register button is clicked, the system ignores that they are required.

  <add name="TeamOrIndividual"
    type="System.String"
    allowMarkup="false"
    resourceFile="ProfileResource"
    labelResourceKey="TeamOrIndividualLabel"
    lazyLoad="false"
    requiredForRegistration="true"
    showOnRegistration="false"
    allowAnonymous="true"
    visibleToAnonymous="false"
    visibleToAuthenticated="true"
    visibleToUser="true"
    editableByUser="true"
   onlyAvailableForRoles=""
    onlyVisibleForRoles=""
     includeHelpLink="true"
   >
      <OptionList>
        <Option value=""></Option>
        <Option value="Team" TextResourceKey="TeamLabel"></Option>
        <Option value="Individual" TextResourceKey="IndividualLabel"></Option>
      </OptionList>
    </add>

 

4/17/2015 10:44:14 AM
Gravatar
Total Posts 18439

Re: user profile custom fields

same problem was previously reported on this thread. It is fixed in the source code repository so it will be fixed in the next release, which should happen in the next few weeks.

Hope that helps,

Joe

4/17/2015 6:15:12 PM
Gravatar
Total Posts 16

Re: user profile custom fields

Thanks, Joe.

I tried to use regex but it only gives me an error when a selection is made.  It is not giving an error when the field is empty.

Has anyone had any luck with regex and option lists with no selection?

We will be done with the current year soon with this client (school year based program), so a build in a couple weeks will be too late.  So I guess regex is our best bet at this point.

Michele

 

 

 

 

4/18/2015 4:05:39 PM
Gravatar
Total Posts 18439

Re: user profile custom fields

I tried without success to make a regex that would reject an empty string. When I fixed it I added a required field validator since I could not get the regex to do what I wanted.

Maybe it could work with a non empty value like "none" and then possibly a regex that will reject that word. I didn't try that and I'm no regex expert myself.

If you can't get that working then maybe remove the empty choice from the list and make the most common choice the first one. Probably people would change it to what is appropriate especially if no empty choice exists.

4/21/2015 9:16:58 AM
Gravatar
Total Posts 16

Re: user profile custom fields

I got the regex working finally, using your suggestion

 <add name="Gender"
    type="System.String"
    allowMarkup="true"
        resourceFile="ProfileResource"
    labelResourceKey="GenderLabel"
    lazyLoad="false"
    requiredForRegistration="true"
        showOnRegistration="false"
    allowAnonymous="false"
    visibleToAnonymous="false"
    visibleToAuthenticated="true"
    visibleToUser="true"
    editableByUser="true"
    regexValidationExpression="^(?!none$).*"
        regexValidationErrorResourceKey="NoneErrorGender"
    onlyAvailableForRoles=""
    onlyVisibleForRoles=""
    defaultValue="none"
    includeHelpLink="false"
    >
      <OptionList>
        <Option value="none" TextResourceKey="NoneLabel"></Option>
        <Option value="M" TextResourceKey="GenderMaleLabel"></Option>
        <Option value="F" TextResourceKey="GenderFemaleLabel"></Option>
      </OptionList>
    </add>

Thanks for all the help, Joe.

 

You must sign in to post in the forums. This thread is closed to new posts.