0
votes

I am upgrading a DNN site from version 5.06.00 to version 7.03.02. I followed the recommended upgrade path, and worked out all of the kinks with the custom modules. The registration form has a custom boolean field, which is required to be set to TRUE. This used to validate correctly pre-upgrade, but now it is not post-upgrade. The user can submit the form without selecting the "TRUE" radio button.

The custom field is displaying properly. The required asterisk is also displaying. The DOM even has an error message element with the correct custom required message:

<span class='dnnFormMessage dnnFormError'>[required message]</span>

However, this field is set to "display:none" by default and never displays as inline like the other error message elements.

I am not a DNN expert and I did not create this site. I am upgrading it for a client and don't know a ton about how these custom fields all work. I see the custom field enabled in Admin > Site Settings > User Account Settings > Profile Settings. I also see a file called "Profile.ascx.Portal-0.resx" that contains the custom field's main text, help text, and required text. It lives in DesktopModules\Admin\Security\App_LocalResources. I don't know what else I would need to configure or check that would be different from version 5.6 to 7.3.

Thanks for your help!

3

3 Answers

0
votes

It seems like you've checked all of the requirements, but you didn't mention wheter or not the checkbox to require a valid profile for registration is checked. Is it?

Can you verify that the custom field is marked as Required?

It may be worth your while to upgrade to the current version of DNN 7, which is 7.04.02.

I'd recommend making a full site backup before doing the upgrade as that is always the right way to proceed.

The .resx file aren't going to affect the functionality, just the texts that are displayed.

I assume that you are doing much of this work on a test copy of the production site. That being the case, you might want to add another custom boolean field, make it required and see if that one works.

0
votes

This isn't the ideal answer, but since I can't figure out what's wrong DNN-wise, I'm just writing some custom jQuery to find the checked radio button span element, then show/hide that error message based on that. If there is more than one thing wrong with the form, it will only show this message. Then if you corrected that boolean, it would show all other messages. It's not great, but at this point it's better than nothing.

$(".dnnPrimaryAction").click(function (e) {
        var $checkedRadioSpan = $(".dnnRadiobutton-checked");
        var $checkedRadioInput = $checkedRadioSpan.prev();
        var $errorMessage = $checkedRadioInput.siblings(".dnnFormError");

        if($checkedRadioInput.val() === "False") {
            e.preventDefault();
            $errorMessage.show();
        }
        else {
            $errorMessage.hide();
            // continue on with other validation
        }       
});
0
votes

I had quite the same problem. It seems that the error message is not displayed for the first form item, as there is not enough place for it.

After adding a header (h2) above the form, it worked fine.

See Validator errormessage is not displayed in the DNN Community forums for more information.