Custom Override Does Not Work for Group Registration

  • temills
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 10 months ago #125695 by temills
Hi Tuan,
We use a custom override of view/register (in view/override/register) to add a variable for the event year. We then use a custom javascript (in media/com-eventbooking/assets/js) to check compliance of two custom fields (identified by class) using the event year as one of the parameters. This works well for individual registration but does not function for group registration. How can I get this to work for groups?

Thanks for your help,
Tem

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #125699 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Override Does Not Work for Group Registration
Hi Tem

Without knowing exactly the customization you made, and what's wrong, there is no way for me to know why it does not work

Maybe you can send us the link to the page and explain how you expect it to work so that I can look at it?

Tuan

Please Log in or Create an account to join the conversation.

  • temills
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 10 months ago #125722 by temills
Hi Tuan,
I since discovered the cause: On individual registration, the id/name of the input is correctly identified to the script function, but on group registration, the id/name of the input is affixed with an underscore and sequence number (e.g., _1) that is not recognized by the script.

I use "onblur" to trigger the function, so I need to discover a way to get the function to recognize the specific input element(s) when triggered. For instance, (1) identify the input that triggered the blur, (e.g., YOB_1), (2) identify the corresponding input, (e.g., Category_1), (3) and run the test with those two inputs. Any suggestions dearly welcomed.

I'll post the solution to the forum when I discover it.

Thanks again,
Tem

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #125723 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom Override Does Not Work for Group Registration
Hi Tem

I must be honest that I am not good at javascript, so I am afraid of I could not give good suggestion

I am not sure how you add event trigger to the input? I am sure there must be a way to get the element which the event occurs

For example, onblur="eventHandle(this);"

Then inside eventHandle function, we should be allowed to access to the element attributes like id, name....

Tuan

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago - 4 years 8 months ago #127309 by Brian F
Hello Tem, did you find a solution? This may not be what you're needing but I have a "Member ID" custom field in our registration form, with that field having the class "memberId".

Using the Member ID field in my case as an example, to get the attributes of the onblur Member ID field within the members of a group registration, I'm currently using the below event function for the group registration form. I'm sure there's a better way but it's working for me.

On a side note, I using "on('blur', '#eb-form-group-members .memberId'" below to target only the group registration form due to in my case where I'm doing other actions to the group members form that I don't apply to the individual registration form, in some cases just doing "on('blur', '.memberId'" may work.

Last edit: 4 years 8 months ago by Brian F.

Please Log in or Create an account to join the conversation.

  • temills
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago #127320 by temills
Hi Brian,
I've found a solution, but I haven't been able to fully test it yet. I attach my event listener further down in the form, i.e., after the member information portion is created. I also needed to return information from more than one element for each member, so the sequence number was essential for my purposes.

Attaching the event listener at the top of the form, as you did, may work for me, I'll have to give it a try later. I notice that you return both the element name and id, but on my forms the name = id; so returning both would be redundant. Also, 'this" must be returning the event target values, I'll verify this later.
Thanks for following up, I'll be happy to send you my code if you like.

Thanx,
Tem

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #127344 by Brian F
Hi Tem, thanks for the update, and yes please, would love to see your code if you don't mind, that would help out.

Oh I'm sorry, I forgot to mention that I included a few different variables in case someone needed those examples. As in your case, I just used the element id and the input value.

Thanks again.

Please Log in or Create an account to join the conversation.

  • temills
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago #127346 by temills
Hi Brian,
Attached is my code in its current state (still need some cleanup). Had to zip it, as js attachments are not allowed.
Would appreciate any feedback for improvement.

Tem
Attachments:
The following user(s) said Thank You: Brian F

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #127347 by Brian F
Oh wow, that some great stuff. All I do is pass the couple variables to a PHP file via an AJAX execution to do the member ID validation against a Db table - HA. Nothing near as advanced as what you coded, nice work. Thank you for sharing!

Please Log in or Create an account to join the conversation.

  • temills
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 years 8 months ago #127422 by temills
Hi Brian,
Attached is a file with corrected variable names on lines 64 and 77.
Tem
Attachments:
The following user(s) said Thank You: Brian F

Please Log in or Create an account to join the conversation.