You need to sign in to do that
Don't have an account?
Praveen Venkata B
Jquery UI tabs enable/disable
I'm using jquery ui tabs on my Visualforce page. Below is the code:
In TAB_B tab, i have a radio buttons field "Are you sure" with vaues "Yes" or "No". Upon clicking on save, i'm saving this selected value to a checkbox field "proceed__c" on to the record. If it is Yes, then check box is checked on record. And if it is No, checkbox is unchecked on record.
Now depending on the value available on the checkbox for a record, i need to enable next tab i.e., TAB_C. If the checkbox is checked on the record, i need to enable TAB_C. If it is unchecked, then even if user clicks on TAB_C, nothing should happen.
Please help to code this.
<div id="tabs" clas="ui-tabs ui-widget ui-widget-content ui-corner-all"> <div> <ul class="nav nav-tabs"> <li class="active"> <a href="#tab1" style="text-decoration:none; font-weight: 700; color:black">TAB_A</a> </li> <li> <a href="#tab2" style="text-decoration:none; font-weight: 700;color:black">TAB_B</a> </li> <li> <a href="#tab3" style="text-decoration:none; font-weight: 700;color:black">TAB_C</a> </li> <li> <a href="#tab4" style="text-decoration:none; font-weight: 700;color:black">TAB_D</a> </li> <li> <a href="#tab5" style="text-decoration:none; font-weight: 700;color:black">TAB_E</a> </li> </ul> </div>I have defined each tab as below:
<section id="tab1" class="tab-content active"> <div style="padding:12px;border-right: 1px solid #C0C0C0 !important;border-left: 1px solid #C0C0C0 !important;border-bottom: 1px solid #C0C0C0 !important;"> Content in tab 1 </div> </section>
In TAB_B tab, i have a radio buttons field "Are you sure" with vaues "Yes" or "No". Upon clicking on save, i'm saving this selected value to a checkbox field "proceed__c" on to the record. If it is Yes, then check box is checked on record. And if it is No, checkbox is unchecked on record.
Now depending on the value available on the checkbox for a record, i need to enable next tab i.e., TAB_C. If the checkbox is checked on the record, i need to enable TAB_C. If it is unchecked, then even if user clicks on TAB_C, nothing should happen.
Please help to code this.
i can give you my own thought of logic
All Answers
please use ids for tag's, there no disabled attribute for href
try to user jquery function
$("#tabc").removeAttr("href")
thank you for your valuable reply !!
I'll add id attribute in anchor tag for each tab as below:
TAB_A --> id="#taba"
TAB_B --> id="#tabb"
TAB_C --> id="#tabc"
TAB_D --> id="#tabd"
Can you share the code snippet like?
i can give you my own thought of logic