Customising Register.aspx

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
3/11/2015 3:27:27 PM
Gravatar
Total Posts 5

Customising Register.aspx

Hey everyone. I've been looking for ways to customise the registration form.

One of my requirements is that on registration I have to capture how the user heard about this site. I have to present them with a number of options and this needs to be a required field. I've tried implementing this through editing mojoProfile.config. Te field renders fine, but it isn't making it required. Here is my markup:

<add name="HearAboutUs"
    type="System.Integer"
    allowMarkup="false"
    resourceFile="ProfileResourceCRC"
    labelResourceKey="HearAboutUs"
    lazyLoad="false"
    requiredForRegistration="true"
    showOnRegistration="true"
    allowAnonymous="false"
    visibleToAnonymous="false"
    visibleToAuthenticated="true"
    visibleToUser="true"
    editableByUser="true"
    regexValidationExpression=""
    regexValidationErrorResourceKey=""
    onlyAvailableForRoles=""
    onlyVisibleForRoles=""
    defaultValue=""
    >
    <OptionList>
        <Option value="" TextResourceKey="HAUUnselectedLabel"></Option>
        <Option value="1" TextResourceKey="HAULabel1"></Option>
        <Option value="2" TextResourceKey="HAULabel2"></Option>
        <Option value="3" TextResourceKey="HAULabel3"></Option>
        <Option value="4" TextResourceKey="HAULabel4"></Option>
        <Option value="5" TextResourceKey="HAULabel5"></Option>
        <Option value="6" TextResourceKey="HAULabel6"></Option>
    </OptionList>
</add>

Is it possible to make an OptionList a required field?

Finally, how would you suggest I go about adding my own custom validation to this form? There are two things I need to validate:

1. If they select "other" from the OptionList above, I need to require the user to enter how they found out about this site through a textbox.

2. I have two other custom fields called PostCode and AddressLine1. I am developing this website/webapp for a city council. In my database I already have a table of possible postcodes and addresses. Before allowing somebody to register, I need to ensure that their address is valid and appears in my database. 

Is there some sort of custom validator that I could leverage? If not how would you suggest I go about this? Will I need to rewrite this form from scratch?

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