Skip to Content Skip to Menu

[SOLVED] Trying to Verify Current Password CB field against Joomla user password

10 years 7 months ago #242573 by prestoproducts
How can I add a tag to the custom cb text field input? I see where I can add code in a trigger, but that code has to be able to load within the input. In the fiddle for example I need to add:
Code:
onclick="this.value='';$(this).attr('type','password');

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242581 by krileon
Just use jQuery and add or change the attributes. You don't need any sort of onclick behavior. Code action with Method set to jQuery example as follows.

Code:
$( '#password' ).attr( 'type', 'password' );

You'll need to right click and click Inspect Element in Chrome or Firefox to inspect the DOM of the input. This way you can get its ID to use in the above jQuery example.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

10 years 7 months ago #242588 by prestoproducts
I am not the best with jQuery, but when I inspected the element with Firebug I get the cb field name back as the id. In this case it is cb_currentpass. I then set up the trigger as I understood it to be:



After refreshing the user I tested it and the field type did not change. Can you please have a look at my trigger config here and let me know where I am off?

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

10 years 7 months ago #242640 by prestoproducts
Hey Kyle,

Did you have a chance to review my last post?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago - 10 years 7 months ago #242648 by krileon
Seams to work fine in all my tests using the below for example.

Type: Code
Triggers: onBeforeUserProfileEditDisplay
Access: Everybody
Method: jQuery
Code:
Code:
$( '#cb_emailaddress' ).attr( 'type', 'password' );

The above example makes my cb_emailaddress behave like a password HTML type. to test begin typing and see if all that is visible is stars. This will not change the storage or validation behavior at all though. It's just going to change its display behavior.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 7 months ago by krileon.

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

10 years 7 months ago #242657 by prestoproducts
Thanks for the clarification. I have attempted the exact setup as you noted and am not able to replicate it. I have a few more tests to run on this and I will let you know if I am able to uncover any results.

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

Moderators: beatnantkrileon
Powered by Kunena Forum