Skip to Content Skip to Menu

[SOLVED] Changing Field-Value by click on link with following redirect to given url

10 years 5 months ago - 10 years 4 months ago #245489 by avateamcom
Hello All,

I want to change two field-values when clicking a link or button with automatic redirect to another url. What do you think is the best way to solve this within cb?

Example: User wants to extend his profile-information because he is a member of a special group. he should activate this mode by changing a field-status from 0 to 1 and then can get to the next tab by clicking one link.

If I didn't explain that properly enough, please feel free to ask me.. :)

Thanks a lot for your help!!

Best regards,
-Stefan
Last edit: 10 years 4 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245520 by krileon
You could use CB Conditional to show your tab after the user checks a checkbox field. This would be done with jQuery and no redirects or page loads needed. Alternative I guess is to design a plugin or some jQuery to append to the page to specifically do what you're wanting.


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.
The following user(s) said Thank You: avateamcom

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

10 years 5 months ago #245561 by avateamcom
Hello Kyle,

thank you for your ideas. I now checked some of my possibilities and got nearly through it with a separate variable and by checking the dynamic tabs. Now a question to that:

Is there a simple way to call a javascript or jquery-function maybe with parameters to change the view to another tab (already displayed, but not active)?

Example: I have some tabs for a special usergroup. the users should fill them when getting into this group. I redirect to a hidden tab by a link, there, a delimiter-field shows - depending on a hidden variable-status - a next-link. i want to change the visible tab to the next tab by clicking on the link. can this be done if i use tab-id i.e.?

Is there a documentation anywhere about these jquery-stuff?

Thank you in advance for your help!!

Best regards,
Stefan

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245591 by krileon
You would need to use CB Auto Actions and its Code action with Method set to jQuery on the profile edit display trigger. This would append your jQuery to the page. Your jQuery would then need to call showCBTab('TAB_HERE'); JS function which should change the tab. Aside from that you'd have to call a click event on the tab title to get it to change, which is hard to do in CB 1.x as the tab titles are missing IDs to target a specific tab.

Is there a documentation anywhere about these jquery-stuff?

The jQuery documentation can be found below.

api.jquery.com/

jQuery tutorials can be found below.

www.w3schools.com/jquery/default.asp


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 5 months ago - 10 years 5 months ago #245696 by avateamcom
Hi Kyle,

sorry for the delay, now I had time to check that. I think i basically understood what you mean.
Here is what I did before: I added a button to every tab which should be clicked when changing to the next tab. in this button (a simple <a>-tag), I inserted an onclick="showCBtab('28')" for calling the tab, but nothing happened.

I now added the CB Auto Action as you wrote, I think i don't need a click event on the tab title, because I have the "next..."-Button on the tab, right?
Its not clear for me how these parts should work together now. Could you please so kind and explain it to me what I am missing here?

I get the following error, maybe this helps:
Uncaught ReferenceError: showCBtab is not defined

can i define this function with cb auto action?
I just changed the code in cb auto action to the following code, but unfortunately no change:

$(document).ready( function() {
$('#nexttab1').click( function() {
showCBtab('31');
} );
} );

Sorry for asking again and maybe writing nonsense, but jQuery is unfortunately not really my profession and I'd only need it here it seems.. :/

Thank you in advance!!

-Stefan
Last edit: 10 years 5 months ago by avateamcom.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245741 by krileon
Looks like the function only works on load. The only way you'll be able to do this then is to use jQuery and trigger a click handler on the tab it self. That's hard to do in 1.x though as the tabs themselves don't have unique ids like they do in CB 2.0. You'll need to target the ul li then do an index check using jQuery or counting through. It's basically what CB Conditionals did, but it really doesn't work very well.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum