Office Use Only custom fields

  • Peter Collins
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 3 months ago #99355 by Peter Collins
Office Use Only custom fields was created by Peter Collins
We wish to add three new custom fields that are NOT displayed on the event registration form but can be used by the admin to add further info once the attendee has registered eg. DateOfLastPayment, PaymentMethod (eg. Direct debit, Cheque, Cash), AmountPaid NOTE: we are only using Offline Payment

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

More
8 years 3 months ago - 8 years 3 months ago #99359 by James Riley
Replied by James Riley on topic Office Use Only custom fields
Here's a little hack that could work...

Create a CSS class for your website (or for Event Booking in [Configuration -> Custom CSS tab -> Custom CSS] ) such as
Code:
.officeUse {display:none;}
and put that CSS Class name into the [Css Class] field in any custom field that you don't want the user to see.


Also, turn on the option in the the custom field for [Hide-on-email] so that the user doesn't see the field in their confirmation email.



And now you have a field that will appear in the backend, but not on the user registration form!

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 8 years 3 months ago by James Riley.

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

More
8 years 3 months ago #99373 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Office Use Only custom fields
Or maybe set access level of the custom field to Special would help

Tuan

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

More
8 years 3 months ago #99389 by Chris Jarvis
Replied by Chris Jarvis on topic Office Use Only custom fields
Hi James
I'm really interested in this idea you suggest as I am trying to find a way of showing certain custom fields to the logged in front end users of Membership Pro - but not allowing them to update data in certain fields, a read only almost.
I've tried playing around but can't get it to work yet.

I've added your idea to the Custom CSS area of the Configuration page of Membership Pro and was thinking about changing the
.officeUse {display:none;}

to
.officeUse {pointer-events:none;}

I can't get the field in question to hide yet though.
When I create the CSS code in Custom CSS do I need to prefix the .officeUse part with any #name?

You helped me massively last week and I am still worried this might be down to my site cache taking a while to clear each time.
Did you get it to work at all?

Thanks again
Chris

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

More
8 years 3 months ago - 8 years 3 months ago #99417 by James Riley
Replied by James Riley on topic Office Use Only custom fields

Chris Jarvis wrote: Hi James
.officeUse {pointer-events:none;}
I can't get the field in question to hide yet though.
When I create the CSS code in Custom CSS do I need to prefix the .officeUse part with any #name?


^ I think that should work. Sounds like a laggy cache issue again. If it works when you add the CSS manually through the Dev Tool -> Inspector (works when I test it on a random field on my site :) ), then it should also work if you've applied the proper class to your elements / selector declaration in your CSS.

You don't need to add an ID to the CSS selector (that would be a #whateverID) as the selector .officeUse whould likely be unique within your site and you shouldn't need to further limit the scope by also attaching other classes or IDs. The more items you add to your selector, the longer it takes the user's browser to process and render the page (CSS is all client side rendered, which is why different browsers handle things differently).

And keep in mind: when writing/declaring CSS, put a "." in front of your selectors that you want to use as classes, but when calling CSS through a 'class' attribute, don't put the period in. And don't add a "." if you are using HTML elements as part of your selector. If new CSS isn't working, quite often it's because I've either forgot to:
1) disable/refresh my site cache
2) put a "." in the class attribute or a "#" in the id attribute
  • <div id="#myDivID" class=".myCSSclass"> (wrong)
  • <div id="myDivID" class="myCSSclass"> (correct )
3) added/missed a "." (or a "#") in my CSS selector declaration
  • .myDivID .a span myCSSclass {CSS-Rules-here;} (wrong)
  • #myDivID a span.myCSSclass{CSS-Rules-here;} (right)

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 8 years 3 months ago by James Riley.
The following user(s) said Thank You: Chris Jarvis

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

More
8 years 3 months ago #99460 by Chris Jarvis
Replied by Chris Jarvis on topic Office Use Only custom fields
Thanks again James
I'm getting my head around things so much more thanks to you.
It was a caching issue but from a plugin i use called JCH optimize preventing me seeing the updated changes instantly.
I need to clear the cache there before seeing anything so that is a bonus finding that out.
I also got your original idea of the visibility and hidden CSS changes working great with pointer-events: none; too
I thought this was perfect as you cannot click into the box with your mouse but you can easily just tab with your keyboard and change the data so I cannot go with this option.
I'm really just looking to use the brilliant custom fields approach of OS Membership to show our members all their data we hold but not allow them to change certain fields.
We have different levels of membership with us and we want to encourage our members to progress through higher courses with us and achieve higher results by them seeing their current status but obviously not manually change these details we hold on them sometimes.
I am looking for a way we can achieve this in one central location for them and thought the pointer-events might be the go but you can tab in and change data with your keyboard.
I really would love a proper Office Use Only type field where members can see it but not change things.

Thanks anyway for all the help. Even though I haven't got there with the end result the lessons I have learnt from playing around further have been just as important.
Chris

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

Moderators: Tuan Pham Ngoc