Howdy Tada Team-
Could use some of the @Chem magic fingers with Javascript (@tim.young advised to post in the community vs. a support ticket)
Background
I would like certain form components to be shown (all others are hidden) depending on field block 64 (Facility Type) and field block 62 (Special Conditions).
For example, current example shown on the page has “Healthcare” and Surgery, Anesthetizing Location options showing. I would like to show component 35 and hide 32, 28, and 38.
I have used the following javascript but it does not address what other fields are showing on the page but rather if there are no record entries made. Maybe this will be a good starting point.
TB.render('component_21', function(data) {
if (data.records === undefined || data.records.length > 0) {
TB.hideComponent('component_15');// any code here will run when evaluation has been completed
TB.hideComponent('component_18');// aany code here will run when evaluation has been completed
} else {
TB.hideComponent('component_21');// any code here will run when evaluation has NOT been completed
}
});
TB.render('component_18',function(data){ // Wait for form to laod
data.ele.find('.af-form-submit').click(function(){ // Find the submit button and add a click event
setTimeout(function(){
location.reload(); // Reload the page
},1000) // Reload the page
}); // End Click event
}); // End TB.render function
Any help would be greatly appreciated.
Adam