Hi Board, I have updated one of the input forms and changed it to a TAB format.
I need to add a next button to the bottom, this is ok, sortd this but cant get the links to work, has anyone done this before?
I tried to get the TAB link by hovering over it and I copied this but just get a blank screen.
add a next button to form.
Re: add a next button to form.
Do you mean that you need to create a link that directs to a specific tab in the detail view?
If - then I would also like to know. I have tried, but cannot have it to function. I have tried with the link shown ( like linking to an anchor ) - but it does not function.
Maybe I need the/a magic word
If - then I would also like to know. I have tried, but cannot have it to function. I have tried with the link shown ( like linking to an anchor ) - but it does not function.
Maybe I need the/a magic word
Re: add a next button to form.
sjohn, i may have a solution, added this into the templates/xxxxxxx_templateDV.html file
Code: Select all
$j('#BI_Next').click(function(e){
e.preventDefault();
$j('#form-tabs').find("li.active").removeClass('active');
$j('#form-tabs a[href="#INSERT_YOUR_TAB_NAME_THAT_YOU_WANT_TO_GO_TO_HERE"]').parent().addClass('active');
$j('#form-tabs #INSERT_THE_TAB_NAME_YOU_ARE_MOVING_FROM_THE_CURRENT_ACTIVE_ONE').removeClass('active');
$j('#form-tabs #INSERT_YOUR_TAB_NAME_THAT_YOU_WANT_TO_GO_TO_HERE').addClass('active');
})
Re: add a next button to form.
Hi,
this would work if you have only 2 tabs. If you want you can make it a bit more generic if you have more tabs to navigate through.
You can put the code (with the button creation code) in the hooks folder to the tablename-dv.js file, so it will not be overwritten once you recreate the code.
this would work if you have only 2 tabs. If you want you can make it a bit more generic if you have more tabs to navigate through.
You can put the code (with the button creation code) in the hooks folder to the tablename-dv.js file, so it will not be overwritten once you recreate the code.
Code: Select all
$j('#BI_Next').click(function(e){
e.preventDefault();
links = $j('.nav-tabs').find('a');
hrefs = $j.map(links, link => $j(link).attr('href'));
actual = $j('.nav-tabs .active a').attr('href');
idx = hrefs.indexOf(actual);
if(idx >=0 && idx <= hrefs.length - 2) { // check index is in array bounds
follow=hrefs[idx+1]; // return whatever comes next to item
}
else follow = actual;
$j('.nav-tabs a[href="'+follow+'"]').tab('show');
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.