I have attached a screen shot of the registration form that I am working on. There are several things I need help with.

1. I can't find how to remove the "Add Another Item" and the "Remove" button from the form. I am supposing they are related.

2. I want to hide "This registration is for" dropdown menu assuming that the default selection of "other person" will be what remains as the selection for all registrations. I want to do this because this registration form is only for multiple and single children registrants that are being signed up by parents.

3. Also, I would like to change the language on the drop down menu for some future registrations where I will need this menu showing for selections. Where do I find the place to change the words "other person" to "child"? And what is the selection "other account" used for?

Thank you for your help.

CommentFileSizeAuthor
#14 cck_text.patch4.66 KBrivimey
RegisScreenShot2.png41.93 KBLoube

Comments

queteparece’s picture

Hi Loube,
I'm also looking for the point 2, and in general for how to manipulate the registration form, maybe templates tpl.php?
Could it be possible to do everything by using AJAX and not to redirect the user to another form?

dpi’s picture

I can't find how to remove the "Add Another Item" and the "Remove" button from the form. I am supposing they are related.

This is not from Registration.

2. I want to hide "This registration is for" dropdown menu assuming that the default selection of "other person" will be what remains as the selection for all registrations. I want to do this because this registration form is only for multiple and single children registrants that are being signed up by parents.

As an administrator, you will see all 'person types' (myself/other/email). If you do not want your users to use a person type, then do not give them permission to use these person types (see user permissions list).

Or hook_form_FORM_ID_alter

3. Also, I would like to change the language on the drop down menu for some future registrations where I will need this menu showing for selections. Where do I find the place to change the words "other person" to "child"? And what is the selection "other account" used for?

Localise your strings: http://drupal.org/project/l10n_client ?

  • Myself: your account
  • Other account: a Drupal user account other than the logged in account.
  • Other person: random email

Perhaps you should change the myself string. Unless each child has an email address (other person).

Loube’s picture

Hi dpi,

Thank you for your answers. I am in a bit of a muddle over getting my registration form to behave right.

When I try to register multiple students as an anon user I have a select box with no options. I get the message:
"This registration is for: field is required."

So I enable the permission "Register other people" for anon users. Then I get one selection available "myself". Which is odd. So I go with that and select it for both of my registrants and then I get the message. "Email addresses must be unique for each registrant."

First, how do I get "other people" to show up for anon users?

Second, if a user is anonymous they should only have that selection anyway, right?

Third, if that is true, having the select menu with one option is confusing and strange for the anon user. Can I make "other people" be the default selection and have the menu not show at all for anon users?

I would appreciate any help. Thank you.

dpi’s picture

When I try to register multiple students as an anon user I have a select box with no options. I get the message:
"This registration is for: field is required."

That may be a bug.

So I enable the permission "Register other people" for anon users. Then I get one selection available "myself". Which is odd. So I go with that and select it for both of my registrants and then I get the message. "Email addresses must be unique for each registrant."
[..]
First, how do I get "other people" to show up for anon users?

Myself = Other person when the current user is Anonymous.

"Email addresses must be unique for each registrant."

You can only use one email per host entity. (Event)

Third, if that is true, having the select menu with one option is confusing and strange for the anon user. Can I make "other people" be the default selection and have the menu not show at all for anon users?

I'm not sure it makes sense to omit the form element when there is only one option. Its good to be explicit about who the registration belongs to. Whether it should be in a select element, or plain markup etc, is debatable.

Loube’s picture

I see. I think for now I will just have the registering parents sign up as auth users before they can register their children for the summer programs.

Thank you for your help.

rivimey’s picture

Hi,

I am trying to configure registrations for a very similar purpose: (largely) anon registrations with children as the actual countable items.

I have, for the moment, locally modified my registration.forms.inc file such that in registration_form it reads:

  $form['who_is_registering'] = array(
    '#type' => 'select',
    '#title' => t('This registration is for:'),
    '#description' => (isset($registration->user) ?
        t('Are you registering for yourself or for another person? You can only register once.') :
        t('You are registering for yourself.')
        ),
    '#options' => $who_options,
    '#default_value' => (isset($registration->registration_id) ? $registration->registrant_type($user) : REGISTRATION_REGISTRANT_TYPE_ANON),
    '#required' => TRUE,
  );

which seems to work: it should? be equally possible to add some code derived from

    '#states' => array(
      'visible' => array(
        ':input[name="who_is_registering"]' => array('value' => REGISTRATION_REGISTRANT_TYPE_USER),
      )

that would hide the who_is_registering field entirely if there is only one item in the $who_options array.

Note I have added a #description entry, which I felt was necessary in this instance. Back to the previous point about emails having to be unique, I think modification of "The email to associate with this registration." to indicate this might be helpful.

The above code seems unsure about what to use for isset(), because I am. Both were taken from code elsewhere in this file.

--

To answer the "Add Another Item": it is coming from the Field code because a field you're using has its "number of values" set to "Unlimited". Change that and it will go away.

[In my case, I want it, but don't want the draggable associated with it, because it might confuse and there's no benefit in ordering; but that is another story.]

I added some other code that used hook_form_alter to change the "Add another Item" to read "Add another child"; such code would equally able to change other text, though from my previous experience, it would be tedious.

dpi’s picture

Status: Active » Fixed

I don't think there is anything actionable here.

rivimey’s picture

Hi dpi,

Not sure why you say #7

There was a clear request to hide the Registration For select item when there was just one item, and I included code that got close to this by setting a default value. I would also very much prefer appropriate #description field.

Is it that you need an actual .patch for it?

Ruth

rivimey’s picture

Status: Fixed » Needs review
Loube’s picture

Hi rivemey,

Thank you for your response. Regarding your help with Add Another Item:

"To answer the "Add Another Item": it is coming from the Field code because a field you're using has its "number of values" set to "Unlimited". Change that and it will go away."

I found that the registration form would not let me change the number from unlimited to one. I found the problem to be related to the Field Collection that I used for the registration. I had to go back into each of the fields in the embedded field collection and un-check required. Once I unchecked all of those I was able to change the value on the registration form from unlimited to one. Then I was able to go back and check the field collection items to be required.

dpi’s picture

Status: Needs review » Active

This is for patch review.

levelos’s picture

Status: Active » Closed (fixed)

It is not clear to me what, if anything the issue here is. Going to close and feel free to reopen or post more specific tickets.

dtesch’s picture

"I added some other code that used hook_form_alter to change the "Add another Item" to read "Add another child"

Hi rivimey,

Would you please share the hook_form_alter code you mentioned above and where you included it to make it work. I'm trying to do the same thing and not having much success.

rivimey’s picture

StatusFileSize
new4.66 KB

dtesch, sorry I didn't reply earlier.

The code I used is based on Ken Hawkin's sandbox project at http://drupal.org/sandbox/khawkins98/1266386 which is in turn based on other work. I have attached a patch against ken's current git source.

Ruth

dtesch’s picture

Thanks for this!