Pulling in a form with ajax
there were a few different buttons at the top which, when one is clicked on, a corresponding
form (made with advanced forms) would appear below it.
I get that normally I could do this with an ajax call but is this possible with pulling in various form blocks? What kind of php calls are involved with that?
For example: say the page has 3-5 buttons on the page and each would call up a different form into a position below the buttons.
You use one or more BBAX remote control block to set up the applicable behaviours and then add a trigger block for each button.
The triggers, remote control and BBAX templates are connected together with css selectors.
Before doing this, you should check the forms can happily coexist without the ajax. If there are already conflicts between the forms, ajax loading could suffer the same problem (or may actually help solve such problems). You also need to consider what happens after a form is submitted.
Having said all that, do you really need ajax loading of the forms? If they could all be loaded with the page, simple buttons+expanders may suffice, or an accordion or tabs (like my Magic Tabs addon provides), with either a tab design to look like your buttons, or hidden tabs and a selection of the Magic Tabs jump blocks to reveal.
My Magic Tabs addon can also be used with BBAX as the default BBAX behaviour is to ajax load when the block becomes visible, ie. when its tab or accordion opens.
You are right I was able to accomplish this with some very simple jquery scripting (show/hides more or less.)
Since the forms aren't overly complex it hasn't effected the page size too much.
But I will keep this addon in mind when I need to pull in more complex content.
For example I have a portfolio site coming up next month that could use this.