Registration form questions

Hi,

I have some questions regarding the registration form (and regform editor):

  • text input fields have a restriction on their size (min=5, max=60)
    -> Is this really required?
  • There is currently to way to enforce a length limit on the user input
    -> would this be a desired option?
    (our use case: We want a field ‘Affiliation for badge’, where the badge layout imposes a strict limit on the
    displayable characters, so the user should provide a suitably abbreviated form)

Hello,

I don’t recall that. Could you point me to the place in the code where you found that?

Yes, definitely. Not sure if it would be very simple to implement right now, however, due to the ancient Angular version we’re using. We were waiting till we get a chance to rewrite it.

It’s hidden in the angular templates:
indico/htdocs/js/indico/modules/registration/form/tpls/fields/dialogs/size.tpl.htm
has:

<div class="regFormEditLine">
    <label class="regFormDialogCaption">
        {{ 'Size in char' | i18n }}
    </label>
    <input type="number" name="length"
        ng-model="formData.length"
        ng-class="{hasError: validationStarted && optionsForm.length.$invalid}"
        min="5"
        max="60">
    <i class="info-helper" title="{{ 'Must be between 5 and 60' | i18n }}"></i>
</div>

I think it could be not too hard, as for the possible implementaition there are still a few questions:

  • use a boolean flag (enforce length) and use the field size a upper limit or
  • use separate min/max length fields

Ah, I see what you mean. But that value isn’t enforced, it just sets the display length of the field. That’s why there’s a minimum (otherwise it’d be almost invisible).
But I still believe that having a maximum length could be useful. For the sake of simplicity, we could keep it as a single setting that would be disabled when empty.

I’ll try to prepare a patch for that…
(actually a minimum length is not more work, other than adding another field to the field model.)